deerflow / frontend /src /core /api /api-client.ts
pjpjq's picture
Deploy DeerFlow to Hugging Face Space
033ca06 verified
"use client";
import { Client as LangGraphClient } from "@langchain/langgraph-sdk/client";
import { getLangGraphBaseURL } from "../config";
let _singleton: LangGraphClient | null = null;
export function getAPIClient(): LangGraphClient {
_singleton ??= new LangGraphClient({
apiUrl: getLangGraphBaseURL(),
});
return _singleton;
}