MCPcopy Create free account
hub / github.com/llm-attacks/llm-attacks / combine_prompts

Function combine_prompts

api_experiments/evaluate_api_models.py:102–118  ·  view source on GitHub ↗
(benign, adv, combo='benign+adv')

Source from the content-addressed store, hash-verified

100
101
102def combine_prompts(benign, adv, combo='benign+adv'):
103
104 if benign.startswith('"') and benign.endswith('"'):
105 benign = benign[1:-1]
106
107 if benign.endswith('\n'):
108 benign = benign[:-1]
109
110 if adv.endswith('\n'):
111 adv = adv[:-1]
112
113 if combo == 'benign+adv':
114 return benign + ' ' + adv
115 elif combo == 'adv+benign':
116 return adv + ' ' + benign
117 else:
118 raise NotImplementedError(f"{combo} is not a supported combo.")
119
120def make_checking_fn(method='key_words', **kwargs):
121

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected