mirror of
https://github.com/hoshikawa2/nemo_guardrails_configuration.git
synced 2026-07-09 17:04:20 +00:00
First Commit
This commit is contained in:
@@ -2,8 +2,42 @@ models:
|
||||
- type: main
|
||||
engine: openai
|
||||
model: gpt-4.1
|
||||
parameters:
|
||||
temperature: 0.2
|
||||
max_tokens: 800
|
||||
|
||||
# 🔧 MUITO IMPORTANTE
|
||||
actions:
|
||||
- name: mask_pii
|
||||
function: config.actions.action_mask_pii
|
||||
|
||||
- name: detectar_toxicidade
|
||||
function: config.actions.action_detectar_toxicidade
|
||||
|
||||
- name: detectar_out_of_scope
|
||||
function: config.actions.action_detectar_out_of_scope
|
||||
|
||||
- name: validar_alcada
|
||||
function: config.actions.action_validar_alcada
|
||||
|
||||
- name: validar_groundedness
|
||||
function: config.actions.action_validar_groundedness
|
||||
|
||||
- name: verbalizacao_prematura
|
||||
function: config.actions.action_verbalizacao_prematura
|
||||
|
||||
- name: cmp
|
||||
function: config.actions.action_cmp
|
||||
|
||||
# 🧠 Organização dos rails
|
||||
rails:
|
||||
input:
|
||||
flows: [check toxicidade, check out of scope]
|
||||
flows:
|
||||
- input_check_toxicidade
|
||||
- input_check_out_of_scope
|
||||
|
||||
output:
|
||||
flows: [check verbalizacao prematura, check groundedness]
|
||||
flows:
|
||||
- output_check_verbalizacao_prematura
|
||||
- output_check_groundedness
|
||||
- output_check_cmp
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
define flow check toxicidade
|
||||
pass
|
||||
define flow input_check_toxicidade
|
||||
user input
|
||||
$r = execute detectar_toxicidade(text=$user_input)
|
||||
if $r.allowed == False
|
||||
bot respond "BLOCKED:TOX"
|
||||
|
||||
define flow check out of scope
|
||||
pass
|
||||
|
||||
define flow input_check_out_of_scope
|
||||
user input
|
||||
$r = execute detectar_out_of_scope(text=$user_input)
|
||||
if $r.allowed == False
|
||||
bot respond "BLOCKED:OOS"
|
||||
@@ -1,5 +1,27 @@
|
||||
define flow check verbalizacao prematura
|
||||
pass
|
||||
define flow output_check_cmp
|
||||
|
||||
define flow check groundedness
|
||||
pass
|
||||
$r = execute cmp(resposta="dummy")
|
||||
|
||||
if $r.allowed == False
|
||||
bot respond "BLOCKED:CMP"
|
||||
|
||||
bot respond "OK"
|
||||
|
||||
|
||||
define flow output_check_verbalizacao_prematura
|
||||
|
||||
$r = execute verbalizacao_prematura(resposta="dummy")
|
||||
|
||||
if $r.allowed == False
|
||||
bot respond "BLOCKED:REVPREC"
|
||||
|
||||
bot respond "OK"
|
||||
|
||||
define flow output_check_groundedness
|
||||
|
||||
$r = execute validar_groundedness(resposta="dummy")
|
||||
|
||||
if $r.allowed == False
|
||||
bot respond "BLOCKED:GND"
|
||||
|
||||
bot respond "OK"
|
||||
Reference in New Issue
Block a user