always use custom fetch in openai-adapters

This commit is contained in:
Nate 2025-05-29 10:06:16 -07:00
parent 67b5165229
commit 7e0b9280cb
2 changed files with 3 additions and 10 deletions

View file

@ -1,6 +1,6 @@
{
"name": "@continuedev/openai-adapters",
"version": "1.0.31",
"version": "1.0.32",
"description": "",
"main": "dist/index.js",
"types": "dist/index.d.ts",

View file

@ -1,6 +1,5 @@
import { RequestOptions } from "@continuedev/config-types";
import { fetchwithRequestOptions } from "@continuedev/fetch";
import fetch from "node-fetch";
import {
ChatCompletionChunk,
CompletionUsage,
@ -137,13 +136,7 @@ export function model(options: { id: string; owned_by?: string }): Model {
};
}
export function maybeCustomFetch(requestOptions: RequestOptions | undefined) {
return requestOptions
? (url: any, init: any) =>
fetchwithRequestOptions(url, init, requestOptions)
: undefined;
}
export function customFetch(requestOptions: RequestOptions | undefined) {
return maybeCustomFetch(requestOptions) ?? fetch;
return (url: any, init: any) =>
fetchwithRequestOptions(url, init, requestOptions);
}