microsoft / TaskWeaver

A code-first agent framework for seamlessly planning and executing data analytics tasks.
https://microsoft.github.io/TaskWeaver/
MIT License
5.19k stars 661 forks source link

The output of the planner is empty. #168

Closed Youning97 closed 6 months ago

Youning97 commented 7 months ago

When I instruct the planner to use Chinese, after accepting the feedback from codeinterpreter, the output of the planner is empty.

╰──● sending message to Planner ╭───< Planner > ├─► [init_plan] │ 1. │ 2. │ 3. ├─► [plan] │ 1. │ 2. ├─► [current_plan_step] 2. ├──● │ 0 100002 │ 1 900001 │ .. ... │ 3 900004 │ 4 900005 │ │ [5 rows x 14 columns] ╰──● sending message to User

Youning97 commented 7 months ago
Human   ▶  请用中文回复

╭───< Planner > ├─► [init_plan] │ 1. │ 2. │ 3. ├─► [plan] │ 1. │ 2. ├─► [current_plan_step] 2. ├──● │ 0 │ 1 │ .. ... │ 3 │ 4 │
│ [5 │ 14 ] ╰──● sending message to User TaskWeaver ▶
0 1 .. ... 3 4

[5 14 ]

Youning97 commented 7 months ago

2024-01-29 11:01:52,992 - INFO - LLM output: {"response": [{"type": "init_plan", "content": "1. \n2. \n3. "}, {"type": "plan", "content": "1. \n2. "}, {"type": "current_plan_step", "content": "2. "}, {"type": "send_to", "content": "User"}, {"type": "message", "content": "\n0 \n1 \n.. ... \n3 \n4 \n\n[5 \n14 ]"}]}

zhangxu0307 commented 7 months ago

Hi, @Youning97 ! Could you provide your example query and the LLM model name you used? Thanks.

Youning97 commented 7 months ago

微信图片_20240129112033 微信图片_20240129112043 微信图片_20240129112046 我使用的是 openai 的gpt4-1106

Youning97 commented 7 months ago

HI @zhangxu0307 , I added the legend. In addition, I modified the prompt of the planner to instruct it to reply to the user in Chinese.

zhangxu0307 commented 7 months ago

Would you mind sharing the revised prompt to us? Thanks.

Youning97 commented 7 months ago

version: 0.1 instruction_template: |- You are the Planner who can coordinate CodeInterpreter to finish the user task.

The characters involved in the conversation

User Character

Youning97 commented 7 months ago
Youning97 commented 7 months ago

I have tried other writing methods, for example: planner should reply to User in Chinese. Similar results will still occur

Youning97 commented 7 months ago

Also when I asked the engineer what the attendance rate was, there was something wrong with the code generated by the CI: Human ▶ 工程师的出勤率是多少 TaskWeaver ▶ [CodeInterpreter] [thought] ProgramApe will filter the DataFrame 'attendance_data_df' for rows where the '职能' column contains the term '工程师' to identify engineers. Then, it will calculate the attendance rate based on the '在岗时长' column, considering non-null entries as days attended. ├─► [python] │ # Filter the data for engineers │ engineers_data = attendance_data_df[attendance_data_df[' │ # Calculate the attendance rate for engineers │ attendance_days = engineers_data[' │ # The total number of days is the number of rows in the engineers_data DataFrame │ total_days = len(engineers_data) │ # The attendance rate is the number of days attended divided by the total number of days │ attendance_rate = attendance_days / total_days │
│ # The result is the attendance rate for engineers │ attendance_rate

”attendance_days = engineers_data['“ Only half of the code here is generated, and the Chinese part is not displayed properly.