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

Function format_phind

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

Source from the content-addressed store, hash-verified

1237
1238@register_chat_format("phind")
1239def format_phind(
1240 messages: List[llama_types.ChatCompletionRequestMessage],
1241 **kwargs: Any,
1242) -> ChatFormatterResponse:
1243 _roles = dict(user="### User Message", assistant="### Assistant")
1244 _sep = "\n\n"
1245 _system_message = "### System Prompt\nYou are an intelligent programming assistant."
1246 _messages = _map_roles(messages, _roles)
1247 _messages.append((_roles["assistant"], None))
1248 _prompt = _format_add_colon_single(_system_message, _messages, _sep)
1249 return ChatFormatterResponse(prompt=_prompt)
1250
1251
1252@register_chat_format("intel")

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…