File tree Expand file tree Collapse file tree 13 files changed +6
-20
lines changed
tests/test_configs/with_custom_llm_prompt_action_v2_x Expand file tree Collapse file tree 13 files changed +6
-20
lines changed Original file line number Diff line number Diff line change 5555)
5656from nemoguardrails .embeddings .index import EmbeddingsIndex , IndexItem
5757from nemoguardrails .kb .kb import KnowledgeBase
58- from nemoguardrails .llm .params import llm_params
5958from nemoguardrails .llm .prompts import get_prompt
6059from nemoguardrails .llm .taskmanager import LLMTaskManager , ParsedTaskOutput
6160from nemoguardrails .llm .types import Task
Original file line number Diff line number Diff line change 5656)
5757from nemoguardrails .embeddings .index import EmbeddingsIndex , IndexItem
5858from nemoguardrails .llm .filters import colang
59- from nemoguardrails .llm .params import llm_params
6059from nemoguardrails .llm .types import Task
6160from nemoguardrails .logging import verbose
6261from nemoguardrails .logging .explain import LLMCallInfo
Original file line number Diff line number Diff line change 3636 InteractionSet ,
3737)
3838from nemoguardrails .eval .ui .utils import EvalData
39- from nemoguardrails .llm .params import llm_params
4039from nemoguardrails .llm .taskmanager import LLMTaskManager
4140from nemoguardrails .logging .explain import LLMCallInfo
4241from nemoguardrails .rails .llm .config import Model
Original file line number Diff line number Diff line change 2323
2424from nemoguardrails import LLMRails
2525from nemoguardrails .evaluate .utils import load_dataset
26- from nemoguardrails .llm .params import llm_params
2726from nemoguardrails .llm .prompts import Task
2827from nemoguardrails .llm .taskmanager import LLMTaskManager
2928from nemoguardrails .rails .llm .config import RailsConfig
Original file line number Diff line number Diff line change 2222from nemoguardrails import LLMRails
2323from nemoguardrails .actions .llm .utils import llm_call
2424from nemoguardrails .evaluate .utils import load_dataset
25- from nemoguardrails .llm .params import llm_params
2625from nemoguardrails .llm .prompts import Task
2726from nemoguardrails .llm .taskmanager import LLMTaskManager
2827from nemoguardrails .rails .llm .config import RailsConfig
@@ -235,29 +234,29 @@ def run(self):
235234
236235 if self .check_input :
237236 print (
238- f"% of samples flagged by jailbreak rail: { jailbreak_flagged / len (self .dataset ) * 100 } "
237+ f"% of samples flagged by jailbreak rail: { jailbreak_flagged / len (self .dataset ) * 100 } "
239238 )
240239 print (
241- f"% of samples correctly flagged by jailbreak rail: { jailbreak_correct / len (self .dataset ) * 100 } "
240+ f"% of samples correctly flagged by jailbreak rail: { jailbreak_correct / len (self .dataset ) * 100 } "
242241 )
243242 if jailbreak_error > 0 :
244243 print (
245- f"% of samples where jailbreak model or rail errored out: { jailbreak_error / len (self .dataset ) * 100 } "
244+ f"% of samples where jailbreak model or rail errored out: { jailbreak_error / len (self .dataset ) * 100 } "
246245 )
247246 print ("\n " )
248247 print ("*" * 50 )
249248 print ("\n " )
250249
251250 if self .check_output :
252251 print (
253- f"% of samples flagged by the output moderation: { check_output_flagged / len (self .dataset ) * 100 } "
252+ f"% of samples flagged by the output moderation: { check_output_flagged / len (self .dataset ) * 100 } "
254253 )
255254 print (
256- f"% of samples correctly flagged by output moderation rail: { check_output_correct / len (self .dataset ) * 100 } "
255+ f"% of samples correctly flagged by output moderation rail: { check_output_correct / len (self .dataset ) * 100 } "
257256 )
258257 if check_output_error > 0 :
259258 print (
260- f"% of samples where output moderation model or rail errored out: { check_output_error / len (self .dataset ) * 100 } "
259+ f"% of samples where output moderation model or rail errored out: { check_output_error / len (self .dataset ) * 100 } "
261260 )
262261 print ("\n " )
263262 print (
Original file line number Diff line number Diff line change 2121from nemoguardrails .actions .actions import action
2222from nemoguardrails .actions .llm .utils import llm_call
2323from nemoguardrails .context import llm_call_info_var
24- from nemoguardrails .llm .params import llm_params
2524from nemoguardrails .llm .taskmanager import LLMTaskManager
2625from nemoguardrails .logging .explain import LLMCallInfo
2726
Original file line number Diff line number Diff line change 2121from nemoguardrails .actions import action
2222from nemoguardrails .actions .llm .utils import llm_call
2323from nemoguardrails .context import llm_call_info_var
24- from nemoguardrails .llm .params import llm_params
2524from nemoguardrails .llm .taskmanager import LLMTaskManager
2625from nemoguardrails .llm .types import Task
2726from nemoguardrails .logging .explain import LLMCallInfo
Original file line number Diff line number Diff line change 2424from nemoguardrails .actions import action
2525from nemoguardrails .actions .llm .utils import llm_call
2626from nemoguardrails .context import llm_call_info_var
27- from nemoguardrails .llm .params import llm_params
2827from nemoguardrails .llm .taskmanager import LLMTaskManager
2928from nemoguardrails .llm .types import Task
3029from nemoguardrails .logging .explain import LLMCallInfo
Original file line number Diff line number Diff line change 2222from nemoguardrails .actions import action
2323from nemoguardrails .actions .llm .utils import llm_call
2424from nemoguardrails .context import llm_call_info_var
25- from nemoguardrails .llm .params import llm_params
2625from nemoguardrails .llm .taskmanager import LLMTaskManager
2726from nemoguardrails .llm .types import Task
2827from nemoguardrails .logging .explain import LLMCallInfo
Original file line number Diff line number Diff line change 2222from nemoguardrails .actions .actions import ActionResult , action
2323from nemoguardrails .actions .llm .utils import llm_call
2424from nemoguardrails .context import llm_call_info_var
25- from nemoguardrails .llm .params import llm_params
2625from nemoguardrails .llm .taskmanager import LLMTaskManager
2726from nemoguardrails .llm .types import Task
2827from nemoguardrails .logging .explain import LLMCallInfo
You can’t perform that action at this time.
0 commit comments