From 5681f02778788276c6cd27a16c79470f48584940 Mon Sep 17 00:00:00 2001 From: Caleb Courier Date: Wed, 26 Jun 2024 11:01:32 -0500 Subject: [PATCH] send exec opts to server --- guardrails/guard.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/guardrails/guard.py b/guardrails/guard.py index 4cfd0f0e7..5c1fff95a 100644 --- a/guardrails/guard.py +++ b/guardrails/guard.py @@ -1152,6 +1152,19 @@ def _call_server( if llm_api is not None: payload["llmApi"] = get_llm_api_enum(llm_api, *args, **kwargs) + if not payload.get("prompt"): + payload["prompt"] = self._exec_opts.prompt + if not payload.get("instructions"): + payload["instructions"] = self._exec_opts.instructions + if not payload.get("msg_history"): + payload["msg_history"] = self._exec_opts.msg_history + if not payload.get("reask_prompt"): + payload["reask_prompt"] = self._exec_opts.reask_prompt + if not payload.get("reask_instructions"): + payload["reask_instructions"] = self._exec_opts.reask_instructions + if not payload.get("num_reasks"): + payload["num_reasks"] = self._exec_opts.num_reasks + should_stream = kwargs.get("stream", False) if should_stream: return self._stream_server_call(payload=payload)