mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-23 14:14:46 +08:00
* feat: Add comprehensive Chinese localization support for issue #412 - Add locale parameter to ChatRequest model to capture user's language preference - Implement language-aware template loading in template.py with fallback to English - Update all apply_prompt_template calls to pass locale through the workflow - Create Chinese translations for 14 core prompt files: * Main agents: coordinator, planner, researcher, reporter, coder * Subprocess agents: podcast_script_writer, ppt_composer, prompt_enhancer * Writing assistant: all 6 prose prompts - Update app.py to extract and propagate locale through workflow state - Support both zh-CN and en-US locales with automatic fallback - Ensure locale flows through all agent nodes and template rendering * address the review suggestions
This commit is contained in:
@@ -21,6 +21,8 @@ def create_agent(
|
||||
name=agent_name,
|
||||
model=get_llm_by_type(AGENT_LLM_MAP[agent_type]),
|
||||
tools=tools,
|
||||
prompt=lambda state: apply_prompt_template(prompt_template, state),
|
||||
prompt=lambda state: apply_prompt_template(
|
||||
prompt_template, state, locale=state.get("locale", "en-US")
|
||||
),
|
||||
pre_model_hook=pre_model_hook,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user