File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
preview/reasoning_engines/templates Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -135,8 +135,13 @@ def is_version_sufficient(version_to_check: str) -> bool:
135135
136136class _ArtifactVersion :
137137 def __init__ (self , ** kwargs ):
138+ from google .genai import types
139+
138140 self .version : Optional [str ] = kwargs .get ("version" )
139- self .data = kwargs .get ("data" )
141+ data = kwargs .get ("data" )
142+ self .data : Optional [types .Part ] = (
143+ types .Part .model_validate (data ) if isinstance (data , dict ) else data
144+ )
140145
141146 def dump (self ) -> Dict [str , Any ]:
142147 result = {}
Original file line number Diff line number Diff line change @@ -137,8 +137,13 @@ def is_version_sufficient(version_to_check: str) -> bool:
137137
138138class _ArtifactVersion :
139139 def __init__ (self , ** kwargs ):
140+ from google .genai import types
141+
140142 self .version : Optional [str ] = kwargs .get ("version" )
141- self .data = kwargs .get ("data" )
143+ data = kwargs .get ("data" )
144+ self .data : Optional [types .Part ] = (
145+ types .Part .model_validate (data ) if isinstance (data , dict ) else data
146+ )
142147
143148 def dump (self ) -> Dict [str , Any ]:
144149 result = {}
You can’t perform that action at this time.
0 commit comments