@@ -60,21 +60,27 @@ def __init__(
6060 query : str = None ,
6161 parameters_sample_object : str = None ,
6262 parameters_schema : str = None ,
63+ options : AiAgentToolQueryOptions = None ,
6364 ):
6465 self .name = name
6566 self .description = description
6667 self .query = query
6768 self .parameters_sample_object : Optional [str ] = parameters_sample_object
6869 self .parameters_schema : Optional [str ] = parameters_schema
70+ self .options = options
6971
7072 def to_json (self ) -> Dict [str , Any ]:
71- return {
73+ json_dict = {
7274 "Name" : self .name ,
7375 "Description" : self .description ,
7476 "Query" : self .query ,
7577 "ParametersSampleObject" : self .parameters_sample_object ,
7678 "ParametersSchema" : self .parameters_schema ,
7779 }
80+ if self .options :
81+ json_dict ["Options" ] = self .options .to_json ()
82+
83+ return json_dict
7884
7985 @classmethod
8086 def from_json (cls , json_dict : Dict [str , Any ]) -> AiAgentToolQuery :
@@ -86,6 +92,8 @@ def from_json(cls, json_dict: Dict[str, Any]) -> AiAgentToolQuery:
8692 "ParametersSampleObject"
8793 )
8894 instance .parameters_schema = json_dict .get ("parametersSchema" ) or json_dict .get ("ParametersSchema" )
95+ if options := json_dict .get ("Options" ):
96+ instance .options = AiAgentToolQueryOptions .from_json (options )
8997 return instance
9098
9199
@@ -384,3 +392,22 @@ def from_json(cls, json_dict: Dict[str, Any]) -> AiAgentConfiguration:
384392 "MaxModelIterationsPerCall"
385393 )
386394 return instance
395+
396+
397+ class AiAgentToolQueryOptions :
398+ def __init__ (self , allow_model_queries : bool = None , add_to_initial_context : bool = None ):
399+ self .allow_model_queries = allow_model_queries
400+ self .add_to_initial_context = add_to_initial_context
401+
402+ def to_json (self ) -> Dict [str , Any ]:
403+ return {
404+ "AllowModelQueries" : self .allow_model_queries ,
405+ "AddToInitialContext" : self .add_to_initial_context ,
406+ }
407+
408+ @classmethod
409+ def from_json (cls , json_dict : Dict [str , Any ]) -> AiAgentToolQueryOptions :
410+ return cls (
411+ allow_model_queries = json_dict ["AllowModelQueries" ],
412+ add_to_initial_context = json_dict ["AddToInitialContext" ],
413+ )
0 commit comments