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

Function load_chatbot

api_experiments/evaluate_api_models.py:91–99  ·  view source on GitHub ↗
(*, model_name, configs, add_system_prompt=True)

Source from the content-addressed store, hash-verified

89
90
91def load_chatbot(*, model_name, configs, add_system_prompt=True):
92 if model_name in ['gpt-3.5-turbo', 'gpt-4', 'gpt-4-0314']:
93 chatbot = OpenaiModel(model_name=model_name, add_system_prompt=add_system_prompt)
94 return chatbot, configs
95 elif model_name in ['claude-2', 'claude-instant-1']:
96 chatbot = AnthropicModel(model_name=model_name)
97 return chatbot, configs
98 else:
99 raise NotImplementedError(f"We do not have API keys for {model_name}.")
100
101
102def combine_prompts(benign, adv, combo='benign+adv'):

Callers 1

mainFunction · 0.85

Calls 2

OpenaiModelClass · 0.85
AnthropicModelClass · 0.85

Tested by

no test coverage detected