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

Function getImageMarkdownListFromDelta

src/controllers/chat.js:33–45  ·  view source on GitHub ↗
(delta)

Source from the content-addressed store, hash-verified

31 if (hasToolCalls) return 'tool_calls'
32 if (typeof upstreamReason === 'string' && upstreamReason.length > 0) {
33 const aliases = {
34 end_turn: 'stop',
35 max_tokens: 'length',
36 tool_use: 'tool_calls'
37 }
38 const normalized = aliases[upstreamReason] || upstreamReason
39 const supported = new Set(['stop', 'length', 'tool_calls', 'content_filter', 'function_call'])
40 return supported.has(normalized) ? normalized : null
41 }
42 return upstreamCompleted ? 'stop' : null
43}
44
45const writeOpenAIStreamError = (res, message, code = 'upstream_incomplete', type = 'upstream_stream_error', retryAfterSeconds = null) => {
46 const error = { message, type, code }
47 // Gemelo de anthropic.js#writeAnthropicError: con las cabeceras ya enviadas no hay
48 // Retry-After que poner, asi que la espera real viaja dentro del frame o se pierde.

Callers 2

processSSEPayloadFunction · 0.85
accumulateUpstreamFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected