MCPcopy Index your code
hub / github.com/abetlen/llama-cpp-python / format_openbuddy

Function format_openbuddy

llama_cpp/llama_chat_format.py:1179–1197  ·  view source on GitHub ↗
(
    messages: List[llama_types.ChatCompletionRequestMessage],
    **kwargs: Any,
)

Source from the content-addressed store, hash-verified

1177
1178@register_chat_format("openbuddy")
1179def format_openbuddy(
1180 messages: List[llama_types.ChatCompletionRequestMessage],
1181 **kwargs: Any,
1182) -> ChatFormatterResponse:
1183 _system_message = """You are a helpful, respectful and honest INTP-T AI Assistant named Buddy. You are talking to a human User.
1184Always answer as helpfully and logically as possible, while being safe. Your answers should not include any harmful, political, religious, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses are socially unbiased and positive in nature.
1185If a question does not make any sense, or is not factually coherent, explain why instead of answering something not correct. If you don't know the answer to a question, please don't share false information.
1186You can speak fluently in many languages, for example: English, Chinese.
1187You cannot access the internet, but you have vast knowledge, cutoff: 2021-09.
1188You are trained by OpenBuddy team, (https://openbuddy.ai, https://github.com/OpenBuddy/OpenBuddy), you are based on LLaMA and Falcon transformers model, not related to GPT or OpenAI.
1189
1190"""
1191 _roles = dict(user="User", assistant="Assistant")
1192 _sep = "\n"
1193 system_message = _system_message
1194 _messages = _map_roles(messages, _roles)
1195 _messages.append((_roles["assistant"], None))
1196 _prompt = _format_add_colon_single(system_message, _messages, _sep)
1197 return ChatFormatterResponse(prompt=_prompt)
1198
1199
1200@register_chat_format("redpajama-incite")

Callers

nothing calls this directly

Calls 4

_map_rolesFunction · 0.85
_format_add_colon_singleFunction · 0.85
appendMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…