MCPcopy Create free account
hub / github.com/xerrors/Yuxi / createController

Function createController

web/src/composables/useStreamSmoother.js:91–105  ·  view source on GitHub ↗
(chunk, options)

Source from the content-addressed store, hash-verified

89}
90
91const createController = (chunk, options) => ({
92 skeleton: stripBufferedFields(chunk),
93 contentBuffer: '',
94 reasoningBuffer: '',
95 additionalReasoningBuffer: '',
96 toolCallArgBuffers: new Map(),
97 scheduled: false,
98 frameId: null,
99 lastPushAt: Date.now(),
100 lastEmitAt: 0,
101 lastFrameAt: Date.now(),
102 carryChars: 0,
103 avgIntervalMs: options.defaultIntervalMs,
104 avgChunkChars: Math.max(options.minReserveChars, getIncomingSize(chunk))
105})
106
107const mergeSkeleton = (controller, chunk) => {
108 const stripped = stripBufferedFields(chunk)

Callers 1

pushChunkFunction · 0.85

Calls 2

stripBufferedFieldsFunction · 0.85
getIncomingSizeFunction · 0.85

Tested by

no test coverage detected