add initial testing
This commit is contained in:
@@ -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");
|
||||
}
|
||||
Reference in New Issue
Block a user