From 2e2fe19c7590d850c618f31c36e5c3327a18ad9e Mon Sep 17 00:00:00 2001 From: Li Xin Date: Thu, 8 May 2025 10:02:19 +0800 Subject: [PATCH 1/3] docs: add notes --- .env.example | 3 +++ README.md | 2 +- conf.yaml.example | 1 + docs/configuration_guide.md | 9 +++++++++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index 79403ec..c6015e9 100644 --- a/.env.example +++ b/.env.example @@ -12,3 +12,6 @@ VOLCENGINE_TTS_APPID=xxx VOLCENGINE_TTS_ACCESS_TOKEN=xxx # VOLCENGINE_TTS_CLUSTER=volcano_tts # Optional, default is volcano_tts # VOLCENGINE_TTS_VOICE_TYPE=BV700_V2_streaming # Optional, default is BV700_V2_streaming + +# [!NOTE] +# For model settings and other configurations, please refer to `docs/configuration_guide.md` diff --git a/README.md b/README.md index 0a4664f..b3e2759 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,7 @@ brew install marp-cli Optionally, install web UI dependencies via [pnpm](https://pnpm.io/installation): ```bash -cd web +cd deer-flow/web pnpm install ``` diff --git a/conf.yaml.example b/conf.yaml.example index a7d817b..872a989 100644 --- a/conf.yaml.example +++ b/conf.yaml.example @@ -1,3 +1,4 @@ +# [!NOTE] # Read the `docs/configuration_guide.md` carefully, and update the configurations to match your specific settings and requirements. # - Replace `api_key` with your own credentials # - Replace `base_url` and `model` name if you want to use a custom model diff --git a/docs/configuration_guide.md b/docs/configuration_guide.md index 54776c2..9b7ead8 100644 --- a/docs/configuration_guide.md +++ b/docs/configuration_guide.md @@ -1,5 +1,14 @@ # Configuration Guide +## Quick Settings + +Copy the `conf.yaml.example` file to `conf.yaml` and modify the configurations to match your specific settings and requirements. + +```bash +cd deer-flow +cp conf.yaml.example conf.yaml +``` + ## Which models does DeerFlow support? In DeerFlow, currently we only support non-reasoning models, which means models like OpenAI's o1/o3 or DeepSeek's R1 are not supported yet, but we will add support for them in the future. From 98830dbd04a99a0ba40b4df311bd113d5abbb2cb Mon Sep 17 00:00:00 2001 From: Li Xin Date: Thu, 8 May 2025 10:14:33 +0800 Subject: [PATCH 2/3] docs: update documents --- docs/mcp_integrations.md | 6 ++-- docs/sse_integration_test.md | 68 ------------------------------------ 2 files changed, 3 insertions(+), 71 deletions(-) delete mode 100644 docs/sse_integration_test.md diff --git a/docs/mcp_integrations.md b/docs/mcp_integrations.md index 2ac7a5e..f54cd9f 100644 --- a/docs/mcp_integrations.md +++ b/docs/mcp_integrations.md @@ -18,11 +18,11 @@ ## APIs -### Get Information of MCP Server +### Get metadata of MCP Server **POST /api/mcp/server/metadata** -For stdio type: +For `stdio` type: ```json { "transport": "stdio", @@ -32,7 +32,7 @@ For stdio type: } ``` -For SSE type: +For `sse` type: ```json { "transport": "sse", diff --git a/docs/sse_integration_test.md b/docs/sse_integration_test.md deleted file mode 100644 index 1d00f84..0000000 --- a/docs/sse_integration_test.md +++ /dev/null @@ -1,68 +0,0 @@ -# SSE Integration Test - -## Auto Accepted Case -``` -curl --location 'http://localhost:8000/api/chat/stream' \ ---header 'Accept: */*' \ ---header 'Accept-Language: en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7' \ ---header 'Cache-Control: no-cache' \ ---header 'Connection: keep-alive' \ ---header 'Content-Type: application/json' \ ---data '{ - "messages": [ - { - "role": "user", - "content": "what is mcp?" - } - ], - "thread_id": "test_thread_1", - "auto_accepted_plan": true -}' -``` - -## Human in the Loop Case - -### Initial Plan -``` -curl --location 'http://localhost:8000/api/chat/stream' \ ---header 'Accept: */*' \ ---header 'Accept-Language: en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7' \ ---header 'Cache-Control: no-cache' \ ---header 'Connection: keep-alive' \ ---header 'Content-Type: application/json' \ ---data '{ - "messages": [ - { - "role": "user", - "content": "what is mcp?" - } - ], - "thread_id": "test_thread_2", - "auto_accepted_plan": false -}' -``` - - -### Edit the plan -``` -{ - "messages": [ - { - "role": "user", - "content": "make the last step be comprehensive" - } - ], - "thread_id": "test_thread_2", - "auto_accepted_plan": false, - "interrupt_feedback": "edit_plan" -} -``` - -### Accept the plan -``` -{ - "thread_id": "test_thread_2", - "auto_accepted_plan": false, - "interrupt_feedback": "accepted" -} -``` \ No newline at end of file From 0042b7276aedfff5df4a27d8e858ac46e934b72d Mon Sep 17 00:00:00 2001 From: Li Xin Date: Thu, 8 May 2025 11:13:52 +0800 Subject: [PATCH 3/3] feat: integrated with Amplitude in static website mode --- web/src/app/layout.tsx | 16 ++++++++++++++++ web/src/env.js | 2 ++ 2 files changed, 18 insertions(+) diff --git a/web/src/app/layout.tsx b/web/src/app/layout.tsx index 9fc1ae0..cc95153 100644 --- a/web/src/app/layout.tsx +++ b/web/src/app/layout.tsx @@ -5,8 +5,10 @@ import "~/styles/globals.css"; import { type Metadata } from "next"; import { Geist } from "next/font/google"; +import Script from "next/script"; import { ThemeProviderWrapper } from "~/components/deer-flow/theme-provider-wrapper"; +import { env } from "~/env"; import { Toaster } from "../components/deer-flow/toaster"; @@ -30,6 +32,20 @@ export default function RootLayout({ {children} + { + // NO USER BEHAVIOR TRACKING OR PRIVATE DATA COLLECTION BY DEFAULT + // + // When `NEXT_PUBLIC_STATIC_WEBSITE_ONLY` is `true`, the script will be injected + // into the page only when `AMPLITUDE_API_KEY` is provided in `.env` + } + {env.NEXT_PUBLIC_STATIC_WEBSITE_ONLY && env.AMPLITUDE_API_KEY && ( + <> + + + + )} ); diff --git a/web/src/env.js b/web/src/env.js index 7d4448a..f6bbf3f 100644 --- a/web/src/env.js +++ b/web/src/env.js @@ -11,6 +11,7 @@ export const env = createEnv({ */ server: { NODE_ENV: z.enum(["development", "test", "production"]), + AMPLITUDE_API_KEY: z.string().optional(), }, /** @@ -32,6 +33,7 @@ export const env = createEnv({ NEXT_PUBLIC_API_URL: process.env.NEXT_PUBLIC_API_URL, NEXT_PUBLIC_STATIC_WEBSITE_ONLY: process.env.NEXT_PUBLIC_STATIC_WEBSITE_ONLY === "true", + AMPLITUDE_API_KEY: process.env.AMPLITUDE_API_KEY, }, /** * Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially