add initial testing

This commit is contained in:
William Jeynes
2026-01-27 22:57:49 +00:00
parent fdf8be2414
commit a3201d17a2
11 changed files with 742 additions and 5 deletions
+22
View File
@@ -0,0 +1,22 @@
import { Client } from "@langchain/langgraph-sdk";
// only set the apiUrl if you changed the default port when calling langgraph dev
const client = new Client({ apiUrl: "http://localhost:2024"});
const thread = await client.threads.create();
const streamResponse = client.runs.stream(
thread["thread_id"],
"agent",
{
input: [
{ role: "user", content: "3+5" }
],
streamMode: "messages-tuple",
}
);
for await (const chunk of streamResponse) {
console.log(`Receiving new event of type: ${chunk.event}...`);
console.log(JSON.stringify(chunk.data));
console.log("\n\n");
}