@@ -896,11 +896,12 @@ def __call__(
896896
897897 messages = messages or self ._exec_opts .messages or []
898898
899- # if messages is not None and not len(messages):
900- # raise RuntimeError(
901- # "You must provide messages. "
902- # "Alternatively, you can provide a prompt in the Schema constructor."
903- # )
899+ if messages is not None and not len (messages ):
900+ raise RuntimeError (
901+ "You must provide messages. "
902+ "Alternatively, you can provide messages in the Schema constructor."
903+ )
904+
904905 return trace_guard_execution (
905906 self .name ,
906907 self .history ,
@@ -1113,10 +1114,12 @@ def _single_server_call(self, *, payload: Dict[str, Any]) -> ValidationOutcome[O
11131114 error = "The response from the server was empty!" ,
11141115 )
11151116
1116- guard_history = self ._api_client .get_history (
1117- self .name , validation_output .call_id
1118- )
1119- self .history .extend ([Call .from_interface (call ) for call in guard_history ])
1117+ # TODO reenable this when we have history support in
1118+ # multi-node server environments
1119+ # guard_history = self._api_client.get_history(
1120+ # self.name, validation_output.call_id
1121+ # )
1122+ # self.history.extend([Call.from_interface(call) for call in guard_history])
11201123
11211124 validation_summaries = []
11221125 if self .history .last and self .history .last .iterations .last :
@@ -1179,13 +1182,15 @@ def _stream_server_call(
11791182 validated_output = validated_output ,
11801183 validation_passed = (validation_output .validation_passed is True ),
11811184 )
1182- if validation_output :
1183- guard_history = self ._api_client .get_history (
1184- self .name , validation_output .call_id
1185- )
1186- self .history .extend (
1187- [Call .from_interface (call ) for call in guard_history ]
1188- )
1185+
1186+ # TODO reenable this when sever supports multi-node history
1187+ # if validation_output:
1188+ # guard_history = self._api_client.get_history(
1189+ # self.name, validation_output.call_id
1190+ # )
1191+ # self.history.extend(
1192+ # [Call.from_interface(call) for call in guard_history]
1193+ # )
11891194 else :
11901195 raise ValueError ("Guard does not have an api client!" )
11911196
0 commit comments