Open analyticalpicasso opened 6 months ago
The self check facts
action fetches the data directly from context variables:
https://github.com/NVIDIA/NeMo-Guardrails/blob/main/nemoguardrails/library/self_check/facts/actions.py#L36
evidence = context.get("relevant_chunks", [])
response = context.get("bot_message")
So, if you write the content into those variables, instead of $answer
and $contexts
and set the $check_facts
to True
, it should work (see also this for more context https://github.com/NVIDIA/NeMo-Guardrails/blob/develop/docs/user_guides/guardrails-library.md#usage-2) :
define flow
user ...
$relevant_chunks = execute qa_chain_context(query=$user_message)
$bot_message = execute qa_chain_graph(query=$user_message)
$check_facts = True
bot $answer
# I assume this is just a confirmation message
bot facts checked
Also, you should use $user_message
rather than $last_user_message
.
Let me know if this works.
self check facts
is not working for me here. It doesn't pass anything to evidence. It does pass generated answer to hypothesis. But evidence i completely empty.
Hi,
Working on implementing Fact-check solution. I need to understand how can I send context from
GraphCypherQAChain
.Additionally, I am unable to send multiple bot messages at once to the solution. Kindly help.