mirror of
https://github.com/bytedance/deer-flow.git
synced 2026-05-21 07:26:50 +00:00
Refactor DeerFlow to use Gateway's LangGraph-compatible API
- Updated documentation and comments to reflect the transition from LangGraph Server to Gateway. - Changed default URLs in ChannelManager and tests to point to Gateway. - Removed references to LangGraph Server in deployment scripts and configurations. - Updated Nginx configuration to route API traffic to Gateway. - Adjusted frontend configurations to utilize Gateway's API. - Removed LangGraph service from Docker Compose files, consolidating services under Gateway. - Added regression tests to ensure Gateway integration works as expected. Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
@@ -13,8 +13,8 @@ import { sanitizeRunStreamOptions } from "./stream-mode";
|
||||
*
|
||||
* Reading the cookie per-request (rather than baking it into the SDK's
|
||||
* ``defaultHeaders`` at construction) handles login / logout / password
|
||||
* change cookie rotation transparently. Both the ``/langgraph-compat/*``
|
||||
* SDK path and the direct REST endpoints in ``fetcher.ts:fetchWithAuth``
|
||||
* change cookie rotation transparently. Both the ``/api/langgraph/*`` SDK
|
||||
* path and the direct REST endpoints in ``fetcher.ts:fetchWithAuth``
|
||||
* share :func:`readCsrfCookie` and :const:`STATE_CHANGING_METHODS` so
|
||||
* the contract stays in lockstep.
|
||||
*/
|
||||
@@ -32,8 +32,10 @@ function injectCsrfHeader(_url: URL, init: RequestInit): RequestInit {
|
||||
}
|
||||
|
||||
function createCompatibleClient(isMock?: boolean): LangGraphClient {
|
||||
const apiUrl = getLangGraphBaseURL(isMock);
|
||||
console.log(`Creating API client with base URL: ${apiUrl}`);
|
||||
const client = new LangGraphClient({
|
||||
apiUrl: getLangGraphBaseURL(isMock),
|
||||
apiUrl,
|
||||
onRequest: injectCsrfHeader,
|
||||
});
|
||||
|
||||
|
||||
@@ -19,6 +19,10 @@ export function getBackendBaseURL() {
|
||||
}
|
||||
|
||||
export function getLangGraphBaseURL(isMock?: boolean) {
|
||||
console.log(
|
||||
"env.NEXT_PUBLIC_LANGGRAPH_BASE_URL",
|
||||
env.NEXT_PUBLIC_LANGGRAPH_BASE_URL,
|
||||
);
|
||||
if (env.NEXT_PUBLIC_LANGGRAPH_BASE_URL) {
|
||||
return new URL(
|
||||
env.NEXT_PUBLIC_LANGGRAPH_BASE_URL,
|
||||
|
||||
Reference in New Issue
Block a user