1- from pydantic import BaseModel , Field , field_validator , model_validator
1+ from pydantic import BaseModel , Field , model_validator , validator
22
33
44class TemporalWorkflowConfig (BaseModel ):
@@ -37,9 +37,6 @@ class TemporalWorkerConfig(BaseModel):
3737 )
3838
3939
40- # Removed CustomHeadersConfig - now using simple list[str] for header_allowlist
41-
42-
4340class TemporalConfig (BaseModel ):
4441 """
4542 Simplified temporal configuration for agents
@@ -62,16 +59,15 @@ class TemporalConfig(BaseModel):
6259 description = "List of temporal workflow configurations. Used when enabled=true." ,
6360 )
6461
65- @field_validator ("workflows" )
66- @classmethod
67- def validate_workflows_not_empty (cls , v : list [TemporalWorkflowConfig ] | None ) -> list [TemporalWorkflowConfig ] | None :
62+ @validator ("workflows" )
63+ def validate_workflows_not_empty (cls , v ):
6864 """Ensure workflows list is not empty when provided"""
6965 if v is not None and len (v ) == 0 :
7066 raise ValueError ("workflows list cannot be empty when provided" )
7167 return v
7268
7369 @model_validator (mode = "after" )
74- def validate_temporal_config_when_enabled (self ) -> "TemporalConfig" :
70+ def validate_temporal_config_when_enabled (self ):
7571 """Validate that workflow configuration exists when enabled=true"""
7672 if self .enabled :
7773 # Must have either workflow (legacy) or workflows (new)
0 commit comments