Skip to content

Commit

Permalink
FUNCTINOOOOOO
Browse files Browse the repository at this point in the history
  • Loading branch information
hinthornw committed Jan 10, 2025
1 parent 6d8041f commit 5eac36b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions libs/sdk-js/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ export type {
Checkpoint,
Interrupt,
} from "./schema.js";
export { overrideFetchImplementation } from "./singletons/fetch.js";

export type { OnConflictBehavior, Command } from "./types.js";
4 changes: 2 additions & 2 deletions libs/sdk-js/src/singletons/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5eac36b

Please sign in to comment.