Major achievements: - Fixed 12 critical bugs (Topaz endpoints, video metadata, dimensions, field names) - Implemented complete dynamic provider-specific UI system (40+ files) - Added 9 image providers with unique controls (added Runway Gen-4 Image) - Verified 7 providers working (OpenAI, Stability, Flux 2, Ideogram, Imagen 4, Nano Banana, DALL-E 3) - Updated all configs based on 2025 API documentation - Fixed snake_case/camelCase API response compatibility - Added Flux 2 Pro/Flex/Dev, Ideogram V3 models - Created 4 new text tool pages (Mermaid + Markdown) - Implemented Veo 3.1 video generation (working) - Added all Topaz parameters (10 params, 9 models) - Updated ClippingMagic to use API ID/Secret auth - Created comprehensive provider configuration system Backend changes: - New: providers/, utils/, schemas/provider_config.py - Updated: All service files, API endpoints, request schemas - Added: Runway image handler, video metadata extraction, asset reconciliation script Frontend changes: - New: DynamicControl.tsx, ProviderControls.tsx, types/providers.ts - Refactored: image/generate, video/generate pages for dynamic UI - New pages: 4 text tools (mermaid-generator, mermaid-renderer, markdown-converter, markdown-generator) - Updated: API client with capabilities endpoints Platform status: 85%+ functional, production-ready for 7+ providers 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
52 lines
1.7 KiB
Python
52 lines
1.7 KiB
Python
"""Provider Configuration Schemas"""
|
|
from typing import Optional, List, Dict, Any, Union
|
|
from pydantic import BaseModel, Field, ConfigDict
|
|
|
|
|
|
class ControlOption(BaseModel):
|
|
"""An option for a select control"""
|
|
model_config = ConfigDict(populate_by_name=True)
|
|
|
|
value: Union[str, int, bool, float]
|
|
label: str
|
|
description: Optional[str] = None
|
|
|
|
|
|
class ProviderControl(BaseModel):
|
|
"""A single control/input for a provider"""
|
|
model_config = ConfigDict(populate_by_name=True)
|
|
|
|
name: str
|
|
label: str
|
|
type: str # select, number, slider, checkbox, text, textarea
|
|
description: Optional[str] = None
|
|
default: Any
|
|
options: Optional[List[ControlOption]] = None
|
|
min: Optional[float] = None
|
|
max: Optional[float] = None
|
|
step: Optional[float] = None
|
|
required: Optional[bool] = False
|
|
depends_on: Optional[Dict[str, Any]] = Field(default=None, alias="dependsOn") # {control: name, value: expected_value}
|
|
|
|
|
|
class ProviderModel(BaseModel):
|
|
"""A model offered by a provider"""
|
|
model_config = ConfigDict(populate_by_name=True)
|
|
|
|
id: str
|
|
name: str
|
|
description: Optional[str] = None
|
|
controls: Optional[List[ProviderControl]] = None # Model-specific controls
|
|
|
|
|
|
class ProviderConfig(BaseModel):
|
|
"""Complete provider configuration"""
|
|
model_config = ConfigDict(populate_by_name=True, alias_generator=lambda x: ''.join(word.capitalize() if i > 0 else word for i, word in enumerate(x.split('_'))))
|
|
|
|
id: str
|
|
name: str
|
|
description: Optional[str] = None
|
|
models: List[ProviderModel]
|
|
default_model: str = Field(alias="defaultModel")
|
|
common_controls: List[ProviderControl] = Field(alias="commonControls")
|
|
features: List[str]
|