MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / format_prompt

Function format_prompt

examples/server/chat.mjs:56–60  ·  view source on GitHub ↗
(question)

Source from the content-addressed store, hash-verified

54const instruction = `A chat between a curious human and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the human's questions.`
55
56function format_prompt(question) {
57 return `${instruction}\n${
58 chat.map(m =>`### Human: ${m.human}\n### Assistant: ${m.assistant}`).join("\n")
59 }\n### Human: ${question}\n### Assistant:`
60}
61
62async function tokenize(content) {
63 const result = await fetch(`${API_URL}/tokenize`, {

Callers 1

chat_completionFunction · 0.70

Calls 1

joinMethod · 0.80

Tested by

no test coverage detected