Skip to content

Commit 43f974c

Browse files
authored
Merge pull request #488 from guardrails-ai/err-msg-ref-fields
Use field names in message history instead of explanations
2 parents 0509f80 + 321d87f commit 43f974c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

guardrails/run.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ def prepare(
319319
api, instructions, prompt
320320
)
321321
else:
322-
raise ValueError("Prompt or message history must be provided.")
322+
raise ValueError("'prompt' or 'msg_history' must be provided.")
323323

324324
action.log(
325325
message_type="info",
@@ -378,7 +378,7 @@ def call(
378378
except Exception:
379379
llm_response = api(prompt.source)
380380
else:
381-
raise ValueError("Prompt or message history must be provided.")
381+
raise ValueError("'prompt' or 'msg_history' must be provided.")
382382

383383
action.log(
384384
message_type="info",
@@ -728,7 +728,9 @@ async def async_call(
728728
except Exception:
729729
llm_response = await api(prompt.source)
730730
else:
731-
raise ValueError("Output, prompt or message history must be provided.")
731+
raise ValueError(
732+
"'output', 'prompt' or 'msg_history' must be provided."
733+
)
732734

733735
action.log(
734736
message_type="info",

0 commit comments

Comments
 (0)