File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,6 +3,11 @@ import OpenAI from "openai"
33
44import type { ModelInfo } from "@klaus-code/types"
55
6+ // Install undici-based fetch wrapper when using OpenAI-compatible providers
7+ // This fixes connection issues with localhost on Node.js 20+
8+ import { installUndisciFetchWrapper } from "../utils/undici-fetch-wrapper"
9+ installUndisciFetchWrapper ( )
10+
611import { type ApiHandlerOptions , getModelMaxOutputTokens } from "../../shared/api"
712import { TagMatcher } from "../../utils/tag-matcher"
813import { ApiStream , ApiStreamUsageChunk } from "../transform/stream"
Original file line number Diff line number Diff line change @@ -2,6 +2,11 @@ import OpenAI from "openai"
22
33import { type ModelInfo , type ModelRecord } from "@klaus-code/types"
44
5+ // Install undici-based fetch wrapper when using router-based providers
6+ // This fixes connection issues with localhost on Node.js 20+
7+ import { installUndisciFetchWrapper } from "../utils/undici-fetch-wrapper"
8+ installUndisciFetchWrapper ( )
9+
510import { ApiHandlerOptions , RouterName } from "../../shared/api"
611
712import { BaseProvider } from "./base-provider"
You can’t perform that action at this time.
0 commit comments