MCPcopy Create free account
hub / github.com/Noumena-Network/code / readResponseText

Function readResponseText

src/services/api/openAICompatWsV2Native.test.ts:55–67  ·  view source on GitHub ↗
(response: Response)

Source from the content-addressed store, hash-verified

53}
54
55async function readResponseText(response: Response): Promise<string> {
56 const reader = response.body?.getReader()
57 if (!reader) return ''
58 const decoder = new TextDecoder()
59 let text = ''
60 while (true) {
61 const { done, value } = await reader.read()
62 if (done) break
63 text += decoder.decode(value, { stream: true })
64 }
65 text += decoder.decode()
66 return text
67}
68
69describe('createNativeOpenAICompatWsV2Transport', () => {
70 it('searches both source and bundled native binding locations', () => {

Callers 1

Calls 1

readMethod · 0.45

Tested by

no test coverage detected