-
Notifications
You must be signed in to change notification settings - Fork 512
Description
Please also confirm the following
- I have searched the main issue tracker of NeMo Guardrails repository and believe that this is not a duplicate
Issue Kind
Error in existing documentation
Existing Link
https://github.com/NVIDIA/NeMo-Guardrails/blob/develop/docs/user-guides/configuration-guide.md
Description
I used config.yaml:
`:emphasize-lines: 5-
models:
- type: main
engine: ollama
model: deepseek-r1:70b
parameters:
base_url: http://10.180.158.23:11454
reasoning_config:
remove_reasoning_traces: True
start_token: ""
end_token: ""`
but when I run code ,I checkout the logs:
`(guard) alexqi@cnglus065:~/develop/NeMo-Guardrails/protection/class_xinference_colang1$ python main.py
Entered verbose mode.
09:37:17.999 | Registered Actions ['GetAttentionPercentageAction', 'GetCurrentDateTimeAction', 'UpdateAttentionMaterializedViewAction', 'alignscore request', 'alignscore_check_facts', 'autoalign_factcheck_output_api',
'autoalign_groundedness_output_api', 'autoalign_input_api', 'autoalign_output_api', 'call cleanlab api', 'call fiddler faithfulness', 'call fiddler safety on bot message', 'call fiddler safety on user message', 'call gcpnlp api',
'call_activefence_api', 'content_safety_check_input', 'content_safety_check_output', 'create_event', 'detect_pii', 'detect_sensitive_data', 'jailbreak_detection_heuristics', 'jailbreak_detection_model', 'llama_guard_check_input',
'llama_guard_check_output', 'mask_pii', 'mask_sensitive_data', 'patronus_api_check_output', 'patronus_lynx_check_output_hallucination', 'protect_text', 'retrieve_relevant_chunks', 'self_check_facts', 'self_check_hallucination', 'self_check_input',
'self_check_output', 'summarize_document', 'topic_safety_check_input', 'wolfram alpha request']
09:37:18.585 | Event UtteranceUserActionFinished | {'final_transcript': '纳斯达克指数是什么呢?'}
09:37:18.586 | Event StartInternalSystemAction | {'uid': 'c0f8...', 'action_name': 'create_event', 'action_params': {'event': {'_type': 'StartInputRails'}}, 'action_result_key': None, 'action_uid': '5f4f...', 'is_system_action': True}
09:37:18.586 | Executing action create_event
09:37:18.587 | Event StartInputRails | {'uid': '4b7e...'}
09:37:18.588 | Event StartInternalSystemAction | {'uid': '2390...', 'action_name': 'create_event', 'action_params': {'event': {'_type': 'StartInputRail', 'flow_id': '$triggered_input_rail'}}, 'action_result_key': None, 'action_uid': 'ad31...',
'is_system_action': True}
09:37:18.588 | Executing action create_event
09:37:18.588 | Event StartInputRail | {'uid': '7b19...', 'flow_id': 'self check input'}
09:37:18.589 | Event StartInternalSystemAction | {'uid': 'd90c...', 'action_name': 'self_check_input', 'action_params': {}, 'action_result_key': 'allowed', 'action_uid': '68cc...', 'is_system_action': True}
09:37:18.590 | Executing action self_check_input
09:37:18.594 | Invocation Params {'model': 'deepseek-r1:70b', 'format': None, 'options': {'mirostat': None, 'mirostat_eta': None, 'mirostat_tau': None, 'num_ctx': None, 'num_gpu': None, 'num_thread': None, 'num_predict': None, 'repeat_last_n': None,
'repeat_penalty': None, 'temperature': 0.001, 'stop': None, 'tfs_z': None, 'top_k': None, 'top_p': None}, 'system': None, 'template': None, 'keep_alive': None, 'raw': None, '_type': 'ollama-llm', 'stop': None}
LLM Prompt (4bffd..) - self_check_input
Your task is to check if the user message below complies with the company policy for talking with the financial investment bot.
Company policy for the user messages:
- should not contain harmful data
- should not ask the bot to impersonate someone
- Investment advice should not be given
User message: "纳斯达克指数是什么呢?"
Question: Should the user message be blocked (Yes or No)?
Answer:
LLM Completion (4bffd..)
Okay, so I need to figure out whether the user's message "纳斯达克指数是什么呢?" should be blocked based on the company policy. Let me break this down step by step.
First, let's understand what the message is saying. The user is asking, "What is the Nasdaq index?" in Chinese. So they're seeking information about a specific stock market index.
Now, looking at the company policies:
- Should not contain harmful data: The message doesn't seem to have any harmful content. It's just a question about an index.
- Should not ask the bot to impersonate someone: There's no indication that the user is asking the bot to pretend to be another person or entity.
- Investment advice should not be given: The user isn't asking for advice on investments; they're simply inquiring about what the Nasdaq index is.
So, none of these policies are violated here. The message is a straightforward information request and doesn't cross any of the boundaries set by the company's guidelines.
The user's message is a simple inquiry about the Nasdaq index without any harmful content, impersonation requests, or investment advice. Therefore, it complies with all company policies.
Answer: No
09:37:36.585 | Output Stats None
09:37:36.586 | LLM call took 17.98 seconds
09:37:36.592 | Event mask_prev_user_message | {'uid': 'd102...', 'intent': 'unanswerable message'}
09:37:36.595 | Event BotIntent | {'uid': '4737...', 'intent': 'refuse to respond'}
09:37:36.599 | Event StartInternalSystemAction | {'uid': '1bd0...', 'action_name': 'retrieve_relevant_chunks', 'action_params': {}, 'action_result_key': None, 'action_uid': 'f5e0...', 'is_system_action': True}
09:37:36.600 | Executing action retrieve_relevant_chunks
09:37:36.602 | Event InternalSystemActionFinished | {'uid': '4ebd...', 'action_uid': 'f5e0...', 'action_name': 'retrieve_relevant_chunks', 'action_params': {}, 'action_result_key': None, 'status': 'success', 'is_success': True, 'return_value': '\n',
'events': None, 'is_system_action': True}
09:37:36.607 | Event StartInternalSystemAction | {'uid': '4f95...', 'action_name': 'generate_bot_message', 'action_params': {}, 'action_result_key': None, 'action_uid': '85c0...', 'is_system_action': True}
09:37:36.608 | Executing action generate_bot_message
09:37:36.609 | Phase 3 Generating bot message ...
09:37:36.612 | Event BotMessage | {'uid': '2ea1...', 'text': "I'm sorry, I can't respond to that."}
09:37:36.617 | Event StartInternalSystemAction | {'uid': 'c00d...', 'action_name': 'create_event', 'action_params': {'event': {'_type': 'StartUtteranceBotAction', 'script': '$bot_message'}}, 'action_result_key': None, 'action_uid': 'c106...',
'is_system_action': True}
09:37:36.618 | Executing action create_event
09:37:36.619 | Event StartUtteranceBotAction | {'uid': '174b...', 'script': "I'm sorry, I can't respond to that.", 'action_uid': 'd2b8...'}
09:37:36.623 | Event BotIntent | {'uid': 'fd94...', 'intent': 'stop'}
09:37:36.627 | Total processing took 18.04 seconds. LLM Stats: 1 total calls, 17.98 total time, 0 total tokens, 0 total prompt tokens, 0 total completion tokens, [17.98] as latencies
I'm sorry, I can't respond to that.`
remove_reasoning_traces failed. How should I configure config.yaml to obtain the correct result