@@ -1215,6 +1215,7 @@ def _single_server_call(self, *, payload: Dict[str, Any]) -> ValidationOutcome[O
12151215                    error = "The response from the server was empty!" ,
12161216                )
12171217
1218+             # TODO renable this when we have history support in multi-node server environments 
12181219            # guard_history = self._api_client.get_history( 
12191220            #     self.name, validation_output.call_id 
12201221            # ) 
@@ -1281,14 +1282,15 @@ def _stream_server_call(
12811282                        validated_output = validated_output ,
12821283                        validation_passed = (validation_output .validation_passed  is  True ),
12831284                    )
1284-             if  validation_output :
1285-                 guard_history  =  self ._api_client .get_history (
1286-                     self .name , validation_output .call_id 
1287-                 )
1288-                 # TODO renable this. doesnt work in a multiple server environment 
1289-                 # self.history.extend( 
1290-                 #     [Call.from_interface(call) for call in guard_history] 
1291-                 # ) 
1285+ 
1286+             # TODO reenable this when sever supports multi-node history 
1287+             # if validation_output: 
1288+             #     guard_history = self._api_client.get_history( 
1289+             #         self.name, validation_output.call_id 
1290+             #     ) 
1291+             # self.history.extend( 
1292+             #     [Call.from_interface(call) for call in guard_history] 
1293+             # ) 
12921294        else :
12931295            raise  ValueError ("Guard does not have an api client!" )
12941296
@@ -1370,7 +1372,7 @@ def to_dict(self) -> Dict[str, Any]:
13701372            description = self .description ,
13711373            validators = self .validators ,
13721374            output_schema = self .output_schema ,
1373-             history = [],  # type: ignore 
1375+             history = [c . to_interface ()  for   c   in   self . history ],  # type: ignore 
13741376        )
13751377
13761378        return  i_guard .to_dict ()
0 commit comments