mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-03 06:12:14 +08:00
* fix: apply context compression to prevent token overflow (Issue #721) - Add token_limit configuration to conf.yaml.example for BASIC_MODEL and REASONING_MODEL - Implement context compression in _execute_agent_step() before agent invocation - Preserve first 3 messages (system prompt + context) during compression - Enhance ContextManager logging with better token count reporting - Prevent 400 Input tokens exceeded errors by automatically compressing message history * feat: add model-based token limit inference for Issue #721 - Add smart default token limits based on common LLM models - Support model name inference when token_limit not explicitly configured - Models include: OpenAI (GPT-4o, GPT-4, etc.), Claude, Gemini, Doubao, DeepSeek, etc. - Conservative defaults prevent token overflow even without explicit configuration - Priority: explicit config > model inference > safe default (100,000 tokens) - Ensures Issue #721 protection for all users, not just those with token_limit set
91 lines
3.5 KiB
Plaintext
91 lines
3.5 KiB
Plaintext
# [!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.
|
|
# - Set `verify_ssl` to `false` if your LLM server uses self-signed certificates
|
|
# - A restart is required every time you change the `conf.yaml` file.
|
|
|
|
BASIC_MODEL:
|
|
base_url: https://ark.cn-beijing.volces.com/api/v3
|
|
model: "doubao-1-5-pro-32k-250115"
|
|
api_key: xxxx
|
|
# max_retries: 3 # Maximum number of retries for LLM calls
|
|
# verify_ssl: false # Uncomment this line to disable SSL certificate verification for self-signed certificates
|
|
# token_limit: 200000 # Maximum input tokens for context compression (prevents token overflow errors)
|
|
|
|
# Local model configuration example:
|
|
|
|
# Ollama (Tested and supported for local development)
|
|
# BASIC_MODEL:
|
|
# base_url: "http://localhost:11434/v1" # Ollama OpenAI compatible endpoint
|
|
# model: "qwen3:14b" # or "llama3.2", etc.
|
|
# api_key: "ollama" # Ollama doesn't need real API key
|
|
# max_retries: 3
|
|
# verify_ssl: false # Local deployment usually doesn't need SSL verification
|
|
|
|
# To use Google Ai Studio as your basic platform:
|
|
# BASIC_MODEL:
|
|
# platform: "google_aistudio"
|
|
# model: "gemini-2.5-flash" # or "gemini-1.5-pro", "gemini-2.5-flash-exp", etc.
|
|
# api_key: your_gemini_api_key # Get from https://aistudio.google.com/app/apikey
|
|
# max_retries: 3
|
|
|
|
# Reasoning model is optional.
|
|
# Uncomment the following settings if you want to use reasoning model
|
|
# for planning.
|
|
|
|
# REASONING_MODEL:
|
|
# base_url: https://ark.cn-beijing.volces.com/api/v3
|
|
# model: "doubao-1-5-thinking-pro-m-250428"
|
|
# api_key: xxxx
|
|
# max_retries: 3 # Maximum number of retries for LLM calls
|
|
# token_limit: 150000 # Maximum input tokens for context compression
|
|
|
|
|
|
# OTHER SETTINGS:
|
|
|
|
# Tool-specific interrupts configuration (Issue #572)
|
|
# Allows interrupting execution before specific tools are called.
|
|
# Useful for reviewing sensitive operations like database queries or API calls.
|
|
# Note: This can be overridden per-request via the API.
|
|
# TOOL_INTERRUPTS:
|
|
# # List of tool names to interrupt before execution
|
|
# # Example: interrupt before database tools or sensitive API calls
|
|
# interrupt_before:
|
|
# - "db_tool" # Database operations
|
|
# - "db_read_tool" # Database reads
|
|
# - "db_write_tool" # Database writes
|
|
# - "payment_api" # Payment-related API calls
|
|
# - "admin_api" # Administrative API calls
|
|
# # When interrupt is triggered, user will be prompted to approve/reject
|
|
# # Approved keywords: "approved", "approve", "yes", "proceed", "continue", "ok", "okay", "accepted", "accept"
|
|
|
|
# Search engine configuration (Only supports Tavily currently)
|
|
# SEARCH_ENGINE:
|
|
# engine: tavily
|
|
# # Only include results from these domains
|
|
# include_domains:
|
|
# - example.com
|
|
# - trusted-news.com
|
|
# - reliable-source.org
|
|
# - gov.cn
|
|
# - edu.cn
|
|
# # Exclude results from these domains
|
|
# exclude_domains:
|
|
# - example.com
|
|
# # Include an answer in the search results
|
|
# include_answer: false
|
|
# # Search depth: "basic" or "advanced"
|
|
# search_depth: "advanced"
|
|
# # Include raw content from pages
|
|
# include_raw_content: true
|
|
# # Include images in search results
|
|
# include_images: true
|
|
# # Include descriptions for images
|
|
# include_image_descriptions: true
|
|
# # Minimum score threshold for results (0-1)
|
|
# min_score_threshold: 0.0
|
|
# # Maximum content length per page
|
|
# max_content_length_per_page: 4000
|