Use published package

This commit is contained in:
Tat Dat Duong
2025-06-30 13:51:32 +02:00
parent 9a0cee5cd0
commit 2508aa45ea
3 changed files with 25 additions and 22 deletions
+2 -5
View File
@@ -22,7 +22,7 @@
"uuid": "^9.0.0"
},
"devDependencies": {
"@langchain/langgraph-api": "http://localhost:3123/1750722568240/@langchain/langgraph-api",
"@langchain/langgraph-api": "~0.0.41",
"@langchain/core": "^0.3.61",
"@langchain/langgraph": "^0.3.5",
"@langchain/scripts": "^0.1.4",
@@ -143,8 +143,5 @@
"react-ui/server.js",
"react-ui/server.d.ts",
"react-ui/server.d.cts"
],
"resolutions": {
"@langchain/langgraph-api": "http://localhost:3123/1750722568240/@langchain/langgraph-api"
}
]
}
+14 -9
View File
@@ -1,3 +1,5 @@
import "@testing-library/jest-dom/vitest";
import { describe, it, expect, beforeEach, afterEach, vi } from "vitest";
import { render, screen, waitFor } from "@testing-library/react";
import { userEvent } from "@testing-library/user-event";
@@ -9,8 +11,10 @@ import { StateGraph, MessagesAnnotation, START } from "@langchain/langgraph";
import { MemorySaver } from "@langchain/langgraph-checkpoint";
import { FakeStreamingChatModel } from "@langchain/core/utils/testing";
import { AIMessage, BaseMessageLike } from "@langchain/core/messages";
import "@testing-library/jest-dom/vitest";
import { createServer } from "@langchain/langgraph-api/embed";
import { Hono } from "hono";
import { logger } from "hono/logger";
import { createEmbedServer } from "@langchain/langgraph-api/experimental/embed";
const threads = (() => {
const THREADS: Record<
@@ -26,6 +30,9 @@ const threads = (() => {
) => {
THREADS[threadId] = { thread_id: threadId, metadata: metadata ?? {} };
},
delete: async (threadId: string) => {
delete THREADS[threadId];
},
};
})();
@@ -40,11 +47,11 @@ const agent = new StateGraph(MessagesAnnotation)
.addEdge(START, "agent")
.compile();
const app = createServer({
graph: { agent },
checkpointer,
threads,
});
const app = new Hono();
app.use(logger());
app.route("/", createEmbedServer({ graph: { agent }, checkpointer, threads }));
const server = setupServer(http.all("*", (ctx) => app.fetch(ctx.request)));
function TestChatComponent() {
const { messages, isLoading, error, submit, stop } = useStream({
@@ -82,8 +89,6 @@ function TestChatComponent() {
);
}
const server = setupServer(http.all("*", (ctx) => app.fetch(ctx.request)));
describe("useStream", () => {
beforeEach(() => server.listen());
+9 -8
View File
@@ -678,14 +678,15 @@
zod "^3.25.32"
zod-to-json-schema "^3.22.3"
"@langchain/langgraph-api@http://localhost:3123/1750722568240/@langchain/langgraph-api":
version "0.0.40"
resolved "http://localhost:3123/1750722568240/@langchain/langgraph-api#f14b373a947881c7d113ff96a2329eba31c589ce"
"@langchain/langgraph-api@~0.0.41":
version "0.0.41"
resolved "https://registry.yarnpkg.com/@langchain/langgraph-api/-/langgraph-api-0.0.41.tgz#a8219651dfd097225e66129ce367ef8e0ae23d45"
integrity sha512-LxiVspoVRB5AYBoC04XmigFTjYtEut3Unf9dlwuMgdRMxfyiN/oI3Wuun9Q/Tfn7jYt3E8FVtUqCLgT1QUG3Rw==
dependencies:
"@babel/code-frame" "^7.26.2"
"@hono/node-server" "^1.12.0"
"@hono/zod-validator" "^0.2.2"
"@langchain/langgraph-ui" "workspace:*"
"@langchain/langgraph-ui" "0.0.41"
"@types/json-schema" "^7.0.15"
"@typescript/vfs" "^1.6.0"
dedent "^1.5.3"
@@ -720,10 +721,10 @@
p-retry "4"
uuid "^9.0.0"
"@langchain/langgraph-ui@workspace:*":
version "0.0.40"
resolved "https://registry.yarnpkg.com/@langchain/langgraph-ui/-/langgraph-ui-0.0.40.tgz#d60aa72ddfbdeb1f523e34776778a8eb9f90f2d0"
integrity sha512-QEpda8dejhhT/BwcJ+jdkI4pioag5AEQaA9rtDeC83G4ZPOTXIODlgGSzDDFoi2Z97mNFiGiVRRDze+IOTGEqA==
"@langchain/langgraph-ui@0.0.41":
version "0.0.41"
resolved "https://registry.yarnpkg.com/@langchain/langgraph-ui/-/langgraph-ui-0.0.41.tgz#6c581f150274b397031b687b6a569a220532cb85"
integrity sha512-7PSSYCgijNRrDbYDj0VuxzPMgUSh4uAO0Z35p4GuB0CZliztUaZVtSGET0mRscT7+98HeWdt4GnpP1fLZt8bxg==
dependencies:
"@commander-js/extra-typings" "^13.0.0"
commander "^13.0.0"