Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
jacoblee93 committed Jan 29, 2025
1 parent e01fa01 commit 89f9f8c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
1 change: 0 additions & 1 deletion langchain/src/hub/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ export function generateModelImportMap(
return modelImportMap;
}


export function generateOptionalImportMap(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
modelClass?: new (...args: any[]) => BaseLanguageModel
Expand Down
9 changes: 7 additions & 2 deletions langchain/src/hub/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import { Runnable } from "@langchain/core/runnables";
import type { BaseLanguageModel } from "@langchain/core/language_models/base";
import { load } from "../load/index.js";
import { basePush, basePull, generateModelImportMap, generateOptionalImportMap } from "./base.js";
import {
basePush,
basePull,
generateModelImportMap,
generateOptionalImportMap,
} from "./base.js";

export { basePush as push };

Expand Down Expand Up @@ -37,7 +42,7 @@ export async function pull<T extends Runnable>(
JSON.stringify(promptObject.manifest),
undefined,
generateOptionalImportMap(options?.modelClass),
generateModelImportMap(options?.modelClass),
generateModelImportMap(options?.modelClass)
);
return loadedPrompt;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand Down
7 changes: 6 additions & 1 deletion langchain/src/hub/node.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { Runnable } from "@langchain/core/runnables";
import { basePush, basePull, generateModelImportMap, generateOptionalImportMap } from "./base.js";
import {
basePush,
basePull,
generateModelImportMap,
generateOptionalImportMap,
} from "./base.js";
import { load } from "../load/index.js";

// TODO: Make this the default, add web entrypoint in next breaking release
Expand Down
3 changes: 2 additions & 1 deletion langchain/src/hub/tests/hub.int.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ test("Test LangChain Hub while loading model with dynamic imports", async () =>
includeModel: true,
});
const res = await pulledPrompt.invoke({
question: "Who is the current president of the USA as of today? You must use the provided tool for the latest info.",
question:
"Who is the current president of the USA as of today? You must use the provided tool for the latest info.",
});
expect(res).toBeInstanceOf(AIMessage);
expect(res.tool_calls?.length).toEqual(1);
Expand Down

0 comments on commit 89f9f8c

Please sign in to comment.