From 5eac36ba12015e50a2839946a733e646c637f7b7 Mon Sep 17 00:00:00 2001 From: William Fu-Hinthorn <13333726+hinthornw@users.noreply.github.com> Date: Fri, 10 Jan 2025 14:40:06 -0800 Subject: [PATCH] FUNCTINOOOOOO --- libs/sdk-js/src/index.ts | 1 + libs/sdk-js/src/singletons/fetch.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/sdk-js/src/index.ts b/libs/sdk-js/src/index.ts index 764abbc67..823476249 100644 --- a/libs/sdk-js/src/index.ts +++ b/libs/sdk-js/src/index.ts @@ -17,5 +17,6 @@ export type { Checkpoint, Interrupt, } from "./schema.js"; +export { overrideFetchImplementation } from "./singletons/fetch.js"; export type { OnConflictBehavior, Command } from "./types.js"; diff --git a/libs/sdk-js/src/singletons/fetch.ts b/libs/sdk-js/src/singletons/fetch.ts index ce4a84ece..8ed71b000 100644 --- a/libs/sdk-js/src/singletons/fetch.ts +++ b/libs/sdk-js/src/singletons/fetch.ts @@ -5,14 +5,14 @@ const DEFAULT_FETCH_IMPLEMENTATION = (...args: any[]) => fetch(...args); const LANGSMITH_FETCH_IMPLEMENTATION_KEY = Symbol.for( - "ls:fetch_implementation", + "lg:fetch_implementation", ); /** * Overrides the fetch implementation used for LangSmith calls. * You should use this if you need to use an implementation of fetch * other than the default global (e.g. for dealing with proxies). - * @param fetch The new fetch functino to use. + * @param fetch The new fetch function to use. */ export const overrideFetchImplementation = (fetch: (...args: any[]) => any) => { (globalThis as any)[LANGSMITH_FETCH_IMPLEMENTATION_KEY] = fetch;