@@ -22,6 +22,7 @@ def ask(
2222 enable_background_investigation = True ,
2323 enable_clarification = False ,
2424 max_clarification_rounds = None ,
25+ locale = None ,
2526):
2627 """Run the agent workflow with the given question.
2728
@@ -33,6 +34,7 @@ def ask(
3334 enable_background_investigation: If True, performs web search before planning to enhance context
3435 enable_clarification: If False (default), skip clarification; if True, enable multi-turn clarification
3536 max_clarification_rounds: Maximum number of clarification rounds (default: None, uses State default=3)
37+ locale: The locale setting (e.g., 'en-US', 'zh-CN')
3638 """
3739 asyncio .run (
3840 run_agent_workflow_async (
@@ -43,6 +45,7 @@ def ask(
4345 enable_background_investigation = enable_background_investigation ,
4446 enable_clarification = enable_clarification ,
4547 max_clarification_rounds = max_clarification_rounds ,
48+ locale = locale ,
4649 )
4750 )
4851
@@ -71,6 +74,9 @@ def main(
7174 choices = ["English" , "中文" ],
7275 ).execute ()
7376
77+ # Set locale based on language
78+ locale = "en-US" if language == "English" else "zh-CN"
79+
7480 # Choose questions based on language
7581 questions = (
7682 BUILT_IN_QUESTIONS if language == "English" else BUILT_IN_QUESTIONS_ZH_CN
@@ -105,6 +111,7 @@ def main(
105111 enable_background_investigation = enable_background_investigation ,
106112 enable_clarification = enable_clarification ,
107113 max_clarification_rounds = max_clarification_rounds ,
114+ locale = locale ,
108115 )
109116
110117
0 commit comments