Skip to content

Commit b38b13e

Browse files
committed
fix: update prompt key to final_transcript
1 parent c3a42b7 commit b38b13e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

nemoguardrails/actions/v2_x/generation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -413,19 +413,19 @@ async def passthrough_llm_action(
413413
raw_prompt = raw_llm_request.get()
414414

415415
if raw_prompt is None:
416-
prompt = event["text"]
416+
prompt = event["final_transcript"]
417417
else:
418418
if isinstance(raw_prompt, str):
419419
# If we're in completion mode, we use directly the last $user_message
420420
# as it may have been altered by the input rails.
421-
prompt = event["text"]
421+
prompt = event["final_transcript"]
422422
elif isinstance(raw_prompt, list):
423423
prompt = raw_prompt.copy()
424424

425425
# In this case, if the last message is from the user, we replace the text
426426
# just in case the input rails may have altered it.
427427
if prompt[-1]["role"] == "user":
428-
raw_prompt[-1]["content"] = event["text"]
428+
raw_prompt[-1]["content"] = event["final_transcript"]
429429
else:
430430
raise ValueError(f"Unsupported type for raw prompt: {type(raw_prompt)}")
431431

0 commit comments

Comments
 (0)