mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-17 19:44:45 +08:00
feat: support NEXT_PUBLIC_LANGGRAPH_BASE_URL
This commit is contained in:
@@ -2,12 +2,12 @@
|
||||
|
||||
import { Client as LangGraphClient } from "@langchain/langgraph-sdk/client";
|
||||
|
||||
import { getBackendBaseURL } from "../config";
|
||||
import { getLangGraphBaseURL } from "../config";
|
||||
|
||||
let _singleton: LangGraphClient | null = null;
|
||||
export function getAPIClient(): LangGraphClient {
|
||||
_singleton ??= new LangGraphClient({
|
||||
apiUrl: getBackendBaseURL(),
|
||||
apiUrl: getLangGraphBaseURL(),
|
||||
});
|
||||
return _singleton;
|
||||
}
|
||||
|
||||
@@ -7,3 +7,11 @@ export function getBackendBaseURL() {
|
||||
return "http://localhost:8000";
|
||||
}
|
||||
}
|
||||
|
||||
export function getLangGraphBaseURL() {
|
||||
if (env.NEXT_PUBLIC_LANGGRAPH_BASE_URL) {
|
||||
return env.NEXT_PUBLIC_LANGGRAPH_BASE_URL;
|
||||
} else {
|
||||
return getBackendBaseURL();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user