(headers: Headers)
| 726 | } |
| 727 | |
| 728 | function headersToMultiMap(headers: Headers): LlmInferenceHeaders { |
| 729 | const out: Record<string, string[]> = {}; |
| 730 | headers.forEach((value, name) => { |
| 731 | if (name.toLowerCase() === "set-cookie") { |
| 732 | return; |
| 733 | } |
| 734 | const list = out[name] ?? (out[name] = []); |
| 735 | list.push(value); |
| 736 | }); |
| 737 | const setCookies = headers.getSetCookie(); |
| 738 | if (setCookies.length > 0) { |
| 739 | out["set-cookie"] = setCookies; |
| 740 | } |
| 741 | return out; |
| 742 | } |
| 743 | |
| 744 | function decodeChunkData(data: string, binary: boolean): Uint8Array { |
| 745 | if (binary) { |
no test coverage detected
searching dependent graphs…