MCPcopy Create free account
hub / github.com/Rfym21/Qwen2API / appendCliSystemContent

Function appendCliSystemContent

src/controllers/cli.chat.js:111–143  ·  view source on GitHub ↗
(systemParts, content)

Source from the content-addressed store, hash-verified

109 }
110}
111
112function appendCliSystemContent(systemParts, content) {
113 if (content === undefined || content === null) {
114 return
115 }
116
117 if (Array.isArray(content)) {
118 for (const item of content) {
119 appendCliSystemContent(systemParts, item)
120 }
121 return
122 }
123
124 if (typeof content === 'string') {
125 systemParts.push(makeCliTextPart(content))
126 return
127 }
128
129 if (typeof content === 'object') {
130 if (isInjectedSystemPart(content)) {
131 return
132 }
133
134 if (typeof content.text === 'string' && content.type === 'text') {
135 systemParts.push(content)
136 return
137 }
138
139 systemParts.push(content)
140 return
141 }
142
143 systemParts.push(makeCliTextPart(content))
144}
145
146function ensureCliSystemMessage(messages) {

Callers 1

ensureCliSystemMessageFunction · 0.85

Calls 2

makeCliTextPartFunction · 0.85
isInjectedSystemPartFunction · 0.85

Tested by

no test coverage detected