MCPcopy Create free account
hub / github.com/Shinplex/rever / formatMessagesForRetool

Function formatMessagesForRetool

workers/retool.ts:152–160  ·  view source on GitHub ↗
(msgs: ChatMessage[])

Source from the content-addressed store, hash-verified

150 * ------------------------------------------------------------------------------------------------ */
151type ChatMessage = { role: "user" | "assistant" | "system"; content: string };
152function formatMessagesForRetool(msgs: ChatMessage[]) {
153 let out = "";
154 for (const m of msgs) {
155 const role = m.role === "user" ? "Human" : "Assistant";
156 out += `\n\n${role}: ${m.content}`;
157 }
158 if (msgs.length && msgs[msgs.length - 1].role === "assistant") out += "\n\nHuman: ";
159 return out;
160}
161
162function getBestAccount(modelId: string) {
163 const rec = AVAILABLE_MODELS.find((m) => m.id === modelId);

Callers 1

fetchFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected