mirror of
https://github.com/langchain-ai/llmanager.git
synced 2026-07-01 20:44:01 -04:00
fix deps
This commit is contained in:
+41
-20
@@ -1,8 +1,7 @@
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
import * as ls from "langsmith/jest";
|
||||
import { HumanMessage } from "@langchain/core/messages";
|
||||
import { InMemoryStore, LangGraphRunnableConfig, MemorySaver } from "@langchain/langgraph";
|
||||
import { graph } from "../src/llmanager/index.js";
|
||||
import { Client } from "@langchain/langgraph-sdk";
|
||||
|
||||
const inputs = [
|
||||
{
|
||||
@@ -233,26 +232,48 @@ const inputs = [
|
||||
];
|
||||
|
||||
ls.describe("LLManager", () => {
|
||||
const client = new Client({
|
||||
apiUrl: "http://localhost:2024",
|
||||
});
|
||||
|
||||
let assistantId = "";
|
||||
|
||||
// ls.test.each(inputs)("E2E Test", async ({ inputs }) => {
|
||||
// const threadId = uuidv4();
|
||||
// const assistantId = uuidv4();
|
||||
// const config: LangGraphRunnableConfig = {
|
||||
// configurable: {
|
||||
// assistant_id: assistantId,
|
||||
// thread_id: threadId,
|
||||
// approvalCriteria: undefined,
|
||||
// rejectionCriteria: undefined,
|
||||
// },
|
||||
// };
|
||||
// const store = new InMemoryStore();
|
||||
// const checkpointer = new MemorySaver();
|
||||
// graph.checkpointer = checkpointer;
|
||||
// graph.store = store;
|
||||
// const result = await graph.invoke(inputs, config as any);
|
||||
// console.log(result);
|
||||
// // await client.runs.wait(threadId, assistantId, {
|
||||
// // ifNotExists: "create",
|
||||
// // input: inputs,
|
||||
// // });
|
||||
// });
|
||||
|
||||
beforeAll(async () => {
|
||||
const assistant = await client.assistants.create({
|
||||
graphId: "agent",
|
||||
});
|
||||
assistantId = assistant.assistant_id;
|
||||
});
|
||||
|
||||
ls.test.each(inputs)("E2E Test", async ({ inputs }) => {
|
||||
const threadId = uuidv4();
|
||||
const assistantId = uuidv4();
|
||||
const config: LangGraphRunnableConfig = {
|
||||
configurable: {
|
||||
assistant_id: assistantId,
|
||||
thread_id: threadId,
|
||||
approvalCriteria: undefined,
|
||||
rejectionCriteria: undefined,
|
||||
}
|
||||
}
|
||||
const store = new InMemoryStore();
|
||||
const checkpointer = new MemorySaver();
|
||||
graph.checkpointer = checkpointer;
|
||||
graph.store = store;
|
||||
const result = await graph.invoke(inputs, config as any)
|
||||
const result = await client.runs.wait(threadId, assistantId, {
|
||||
input: inputs,
|
||||
ifNotExists: "create",
|
||||
});
|
||||
console.log(result);
|
||||
// await client.runs.wait(threadId, assistantId, {
|
||||
// ifNotExists: "create",
|
||||
// input: inputs,
|
||||
// });
|
||||
});
|
||||
});
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@
|
||||
"dependencies": {
|
||||
"@langchain/anthropic": "^0.3.17",
|
||||
"@langchain/core": "^0.3.44",
|
||||
"@langchain/langgraph": "file:/Users/bracesproul/code/lang-chain-ai/langgraphjs/libs/langgraph",
|
||||
"@langchain/langgraph": "^0.2.64",
|
||||
"@langchain/langgraph-sdk": "0.0.66",
|
||||
"@langchain/openai": "^0.5.5",
|
||||
"dotenv": "^16.4.7",
|
||||
|
||||
@@ -9,7 +9,6 @@ import { BaseMessage } from "@langchain/core/messages";
|
||||
* @returns The content of the last human message as a string.
|
||||
*/
|
||||
export function findQueryStringOrThrow(messages: BaseMessage[]): string {
|
||||
console.log("messages", messages);
|
||||
const content = messages.findLast((m) => m.getType() === "human")?.content;
|
||||
if (!content) {
|
||||
throw new Error("No query found");
|
||||
|
||||
@@ -1110,14 +1110,14 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@langchain/langgraph-checkpoint@npm:~0.0.16":
|
||||
version: 0.0.16
|
||||
resolution: "@langchain/langgraph-checkpoint@npm:0.0.16"
|
||||
"@langchain/langgraph-checkpoint@npm:~0.0.17":
|
||||
version: 0.0.17
|
||||
resolution: "@langchain/langgraph-checkpoint@npm:0.0.17"
|
||||
dependencies:
|
||||
uuid: ^10.0.0
|
||||
peerDependencies:
|
||||
"@langchain/core": ">=0.2.31 <0.4.0"
|
||||
checksum: ca0d169256f4b82e050297af536d4e8d24b47cd7ea029925845a3b3ae06eaef1fcca566ad9851a608b46f2fe5ff1de77a66d86fcaa808de26b7c97a9afdc061c
|
||||
checksum: c8dc429e66ff5b0f31037c493c4f8687196f1800d52b48e8ff04829742cd7200af66ce46dee93ff3c0f6b6e6c2af36336f09626a5ce296ec610383a3bd7131ef
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -1184,11 +1184,11 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@langchain/langgraph@file:/Users/bracesproul/code/lang-chain-ai/langgraphjs/libs/langgraph::locator=llmanager%40workspace%3A.":
|
||||
version: 0.2.63
|
||||
resolution: "@langchain/langgraph@file:/Users/bracesproul/code/lang-chain-ai/langgraphjs/libs/langgraph#/Users/bracesproul/code/lang-chain-ai/langgraphjs/libs/langgraph::hash=12d526&locator=llmanager%40workspace%3A."
|
||||
"@langchain/langgraph@npm:^0.2.64":
|
||||
version: 0.2.64
|
||||
resolution: "@langchain/langgraph@npm:0.2.64"
|
||||
dependencies:
|
||||
"@langchain/langgraph-checkpoint": ~0.0.16
|
||||
"@langchain/langgraph-checkpoint": ~0.0.17
|
||||
"@langchain/langgraph-sdk": ~0.0.32
|
||||
uuid: ^10.0.0
|
||||
zod: ^3.23.8
|
||||
@@ -1198,7 +1198,7 @@ __metadata:
|
||||
peerDependenciesMeta:
|
||||
zod-to-json-schema:
|
||||
optional: true
|
||||
checksum: 34c2afd6ef2d5e826d0e09efad135e08f276c8b1e593dbeeb81d1a75cdbe02171e6b212da56156c9973d23094a5f45ecfc4b79b0dc9e03d3aa5f6dc4c7295d41
|
||||
checksum: bf90f22a161b23a2aa0d8d71504db2f0c5aaa7f901242efdc8e808195ad97bdbb167cd52201798a56207783036c0b8f295753c0c3199660085d73711f4393590
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -5449,7 +5449,7 @@ __metadata:
|
||||
"@jest/globals": ^29.7.0
|
||||
"@langchain/anthropic": ^0.3.17
|
||||
"@langchain/core": ^0.3.44
|
||||
"@langchain/langgraph": "file:/Users/bracesproul/code/lang-chain-ai/langgraphjs/libs/langgraph"
|
||||
"@langchain/langgraph": ^0.2.64
|
||||
"@langchain/langgraph-cli": ^0.0.21
|
||||
"@langchain/langgraph-sdk": 0.0.66
|
||||
"@langchain/openai": ^0.5.5
|
||||
|
||||
Reference in New Issue
Block a user