27 lines
700 B
TypeScript
27 lines
700 B
TypeScript
"use client";
|
|
|
|
import { useStream } from "@langchain/langgraph-sdk/react";
|
|
import { useParams } from "next/navigation";
|
|
|
|
import { getLangGraphClient } from "@/core/api";
|
|
import type { AgentThreadState } from "@/core/threads";
|
|
|
|
const apiClient = getLangGraphClient();
|
|
|
|
export default function TestPage() {
|
|
const { thread_id: threadId } = useParams<{ thread_id: string }>();
|
|
const thread = useStream<AgentThreadState>({
|
|
client: apiClient,
|
|
assistantId: "lead_agent",
|
|
threadId,
|
|
reconnectOnMount: true,
|
|
fetchStateHistory: true,
|
|
});
|
|
return (
|
|
<div className="p-4">
|
|
<div>{threadId}</div>
|
|
<div>{thread.isLoading ? "loading" : "not loading"}</div>
|
|
</div>
|
|
);
|
|
}
|