openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
10 lines (9 loc) • 647 B
JavaScript
import { a as isOpenAIApiBaseUrl } from "./base-url-CwyeI_Ld.mjs";
//#region extensions/openai/native-web-search-policy.ts
/** Shared by catalog selection and payload construction before any provider request. */
function resolveNativeWebSearch(ctx) {
const provider = ctx.config?.tools?.web?.search?.provider?.trim().toLowerCase();
return ctx.config?.tools?.web?.search?.enabled !== false && (!provider || provider === "auto" || provider === "openai") && ctx.api === "openai-responses" && ctx.provider.trim().toLowerCase() === "openai" && (!ctx.baseUrl || isOpenAIApiBaseUrl(ctx.baseUrl));
}
//#endregion
export { resolveNativeWebSearch as t };