mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-18 20:14:44 +08:00
feat: update save-demo
This commit is contained in:
@@ -4,11 +4,14 @@ import path from "path";
|
|||||||
import { env } from "process";
|
import { env } from "process";
|
||||||
|
|
||||||
export async function main() {
|
export async function main() {
|
||||||
const threadId = process.argv[2];
|
const url = new URL(process.argv[2]);
|
||||||
const url = new URL(
|
const threadId = url.pathname.split("/").pop();
|
||||||
`http://localhost:2026/api/langgraph/threads/${threadId}/history`,
|
const host = url.host;
|
||||||
|
const apiURL = new URL(
|
||||||
|
`/api/langgraph/threads/${threadId}/history`,
|
||||||
|
`${url.protocol}//${host}`,
|
||||||
);
|
);
|
||||||
const response = await fetch(url, {
|
const response = await fetch(apiURL, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
|
|||||||
Reference in New Issue
Block a user