@@ -139,6 +139,38 @@ def to_dict(self) -> dict:
139139 }
140140
141141
142+ # ============================================================================
143+ # Tool Types
144+ # ============================================================================
145+
146+ @dataclass (frozen = True )
147+ class AITool :
148+ """
149+ Configuration for an AI tool.
150+ """
151+ key : str
152+ version : int
153+ instructions : Optional [str ] = None
154+ examples : Optional [str ] = None
155+ custom_parameters : Optional [Dict [str , Any ]] = None
156+
157+ def to_dict (self ) -> dict :
158+ """
159+ Render the tool as a dictionary object.
160+ """
161+ result : Dict [str , Any ] = {
162+ 'key' : self .key ,
163+ 'version' : self .version ,
164+ }
165+ if self .instructions is not None :
166+ result ['instructions' ] = self .instructions
167+ if self .examples is not None :
168+ result ['examples' ] = self .examples
169+ if self .custom_parameters is not None :
170+ result ['customParameters' ] = self .custom_parameters
171+ return result
172+
173+
142174# ============================================================================
143175# Base AI Config Types
144176# ============================================================================
@@ -249,6 +281,7 @@ class AIAgentConfigDefault(AIConfigDefault):
249281 Default Agent-specific AI Config with instructions.
250282 """
251283 instructions : Optional [str ] = None
284+ tools : Optional [List [AITool ]] = None
252285 judge_configuration : Optional [JudgeConfiguration ] = None
253286
254287 def to_dict (self ) -> Dict [str , Any ]:
@@ -258,6 +291,8 @@ def to_dict(self) -> Dict[str, Any]:
258291 result = self ._base_to_dict ()
259292 if self .instructions is not None :
260293 result ['instructions' ] = self .instructions
294+ if self .tools is not None :
295+ result ['tools' ] = [tool .to_dict () for tool in self .tools ]
261296 if self .judge_configuration is not None :
262297 result ['judgeConfiguration' ] = self .judge_configuration .to_dict ()
263298 return result
@@ -269,6 +304,7 @@ class AIAgentConfig(AIConfig):
269304 Agent-specific AI Config with instructions.
270305 """
271306 instructions : Optional [str ] = None
307+ tools : Optional [List [AITool ]] = None
272308 judge_configuration : Optional [JudgeConfiguration ] = None
273309
274310 def to_dict (self ) -> Dict [str , Any ]:
@@ -278,6 +314,8 @@ def to_dict(self) -> Dict[str, Any]:
278314 result = self ._base_to_dict ()
279315 if self .instructions is not None :
280316 result ['instructions' ] = self .instructions
317+ if self .tools is not None :
318+ result ['tools' ] = [tool .to_dict () for tool in self .tools ]
281319 if self .judge_configuration is not None :
282320 result ['judgeConfiguration' ] = self .judge_configuration .to_dict ()
283321 return result
0 commit comments