mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-25 23:14:46 +08:00
fix(main): Passing the local parameter from the main interactive mode (#791)
This commit is contained in:
7
main.py
7
main.py
@@ -22,6 +22,7 @@ def ask(
|
||||
enable_background_investigation=True,
|
||||
enable_clarification=False,
|
||||
max_clarification_rounds=None,
|
||||
locale=None,
|
||||
):
|
||||
"""Run the agent workflow with the given question.
|
||||
|
||||
@@ -33,6 +34,7 @@ def ask(
|
||||
enable_background_investigation: If True, performs web search before planning to enhance context
|
||||
enable_clarification: If False (default), skip clarification; if True, enable multi-turn clarification
|
||||
max_clarification_rounds: Maximum number of clarification rounds (default: None, uses State default=3)
|
||||
locale: The locale setting (e.g., 'en-US', 'zh-CN')
|
||||
"""
|
||||
asyncio.run(
|
||||
run_agent_workflow_async(
|
||||
@@ -43,6 +45,7 @@ def ask(
|
||||
enable_background_investigation=enable_background_investigation,
|
||||
enable_clarification=enable_clarification,
|
||||
max_clarification_rounds=max_clarification_rounds,
|
||||
locale=locale,
|
||||
)
|
||||
)
|
||||
|
||||
@@ -71,6 +74,9 @@ def main(
|
||||
choices=["English", "中文"],
|
||||
).execute()
|
||||
|
||||
# Set locale based on language
|
||||
locale = "en-US" if language == "English" else "zh-CN"
|
||||
|
||||
# Choose questions based on language
|
||||
questions = (
|
||||
BUILT_IN_QUESTIONS if language == "English" else BUILT_IN_QUESTIONS_ZH_CN
|
||||
@@ -105,6 +111,7 @@ def main(
|
||||
enable_background_investigation=enable_background_investigation,
|
||||
enable_clarification=enable_clarification,
|
||||
max_clarification_rounds=max_clarification_rounds,
|
||||
locale=locale,
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user