MCPcopy
hub / github.com/7836246/cursor2api / toBlocks

Function toBlocks

test/unit-openai-compat.mjs:82–87  ·  view source on GitHub ↗
(content)

Source from the content-addressed store, hash-verified

80
81// ─── 内联 mergeConsecutiveRoles(与 src/openai-handler.ts 保持同步)────
82function toBlocks(content) {
83 if (typeof content === 'string') {
84 return content ? [{ type: 'text', text: content }] : [];
85 }
86 return content || [];
87}
88
89function mergeConsecutiveRoles(messages) {
90 if (messages.length <= 1) return messages;

Callers 1

mergeConsecutiveRolesFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected