(input: Pick<StreamInput, "provider" | "auth">)
| 146 | } |
| 147 | |
| 148 | function providerFetch(input: Pick<StreamInput, "provider" | "auth">): typeof globalThis.fetch | undefined { |
| 149 | if (input.provider.id !== "openai" || input.auth?.type !== "oauth") return undefined |
| 150 | const value: unknown = input.provider.options.fetch |
| 151 | if (typeof value !== "function") return undefined |
| 152 | return value as typeof globalThis.fetch |
| 153 | } |
| 154 | |
| 155 | function providerHeaders(value: unknown): Record<string, string> | undefined { |
| 156 | if (!isRecord(value)) return undefined |