-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Update groupchat speaker_selection strategy with self_correctness to mitigate role misalignment #102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
LittleLittleCloud
wants to merge
12
commits into
microsoft:main
from
LittleLittleCloud:u/xiaoyun/groupchat
Closed
Update groupchat speaker_selection strategy with self_correctness to mitigate role misalignment #102
LittleLittleCloud
wants to merge
12
commits into
microsoft:main
from
LittleLittleCloud:u/xiaoyun/groupchat
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report
@@ Coverage Diff @@
## main #102 +/- ##
==========================================
- Coverage 41.03% 40.77% -0.26%
==========================================
Files 17 17
Lines 2091 2136 +45
Branches 469 483 +14
==========================================
+ Hits 858 871 +13
- Misses 1156 1182 +26
- Partials 77 83 +6
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Closed
41f087e to
ff6d41c
Compare
ff6d41c to
5639c16
Compare
…Cloud/autogen into u/xiaoyun/groupchat
3 tasks
Contributor
|
Hi @LittleLittleCloud, do you have a plan to further update this PR? |
jackgerrits
pushed a commit
that referenced
this pull request
Oct 2, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why are these changes needed?
Related issue number
fix #86
This PR also adds the following test cases in order to verify the speaker-selection and termination policy of group chat
chat history
Admin (to chat_manager):welcome to the class. I'm admin here. Teacher, you create 10 math questions for student to answer. Let me know when student resolve all questions.
teacher (to chat_manager):
I'm teacher, I will create 10 math questions for student to answer.
student (to chat_manager):
I'm student, I will answer teacher's questions.
Admin (to chat_manager):
teacher, please start
teacher (to chat_manager):
Great! Let's begin with the first question:
Question 1:
2 + 3 = ?
Student, please resolve the question and tell me the answer.
student (to chat_manager):
Hello teacher, the answer is 5.
teacher (to chat_manager):
Well done, student! That's correct!
Now, let's move on to the next question:
Question 2:
4 - 2 = ?
Student, please resolve the question and tell me the answer.
student (to chat_manager):
Hello teacher, the answer is 2.
teacher (to chat_manager):
Great job, student! That's correct!
Let's move on to the next question:
Question 3:
5 + 7 = ?
Student, please resolve the question and tell me the answer.
student (to chat_manager):
Hello teacher, the answer is 12.
teacher (to chat_manager):
Well done, student! That's correct!
Now, let's move on to the next question:
Question 4:
8 - 3 = ?
Student, please resolve the question and tell me the answer.
student (to chat_manager):
Hello teacher, the answer is 5.
teacher (to chat_manager):
Great job, student! That's correct!
Let's move on to the next question:
Question 5:
6 + 4 = ?
Student, please resolve the question and tell me the answer.
student (to chat_manager):
Hello teacher, the answer is 10.
teacher (to chat_manager):
Well done, student! That's correct!
Now, let's move on to the next question:
Question 6:
9 - 5 = ?
Student, please resolve the question and tell me the answer.
student (to chat_manager):
Hello teacher, the answer is 4.
teacher (to chat_manager):
Great job, student! That's correct!
Let's move on to the next question:
Question 7:
3 + 2 = ?
Student, please resolve the question and tell me the answer.
student (to chat_manager):
Hello teacher, the answer is 5.
teacher (to chat_manager):
Well done, student! That's correct!
Now, let's move on to the next question:
Question 8:
10 - 6 = ?
Student, please resolve the question and tell me the answer.
student (to chat_manager):
Hello teacher, the answer is 4.
teacher (to chat_manager):
Great job, student! That's correct!
Let's move on to the next question:
Question 9:
4 + 6 = ?
Student, please resolve the question and tell me the answer.
student (to chat_manager):
Hello teacher, the answer is 10.
teacher (to chat_manager):
Well done, student! That's correct!
Now, let's move on to the last question:
Question 10:
9 - 4 = ?
Student, please resolve the question and tell me the answer.
student (to chat_manager):
Hello teacher, the answer is 5.
Admin (to chat_manager):
teacher, it's your turn to speak.
teacher (to chat_manager):
[COMPLETE]
Admin (to chat_manager):
Great job, student! You have answered all the questions correctly. Keep up the good work! If you have any more questions or need further assistance, feel free to ask.
chat history
Admin (to chat_manager):welcome to the class. I'm admin here. Teacher, you create 5 easy-level leetcode questions for student to resolve . Let me know when student resolve all questions.
teacher (to chat_manager):
I'm teacher, I will create 5 easy-level leetcode question for student to answer.
student (to chat_manager):
I'm student, I will provide python code to resolve leetcode question. I'll try to fix the bug if there's any.
executor (to chat_manager):
I'm executor, I will run student's code and report result.
Admin (to chat_manager):
teacher, please start
teacher (to chat_manager):
Sure! Let's begin with the first question:
Question 1:
Given an array of integers, return indices of the two numbers such that they add up to a specific target.
You may assume that each input would have exactly one solution, and you may not use the same element twice.
Example:
Input: nums = [2, 7, 11, 15], target = 9
Output: [0, 1]
Explanation: nums[0] + nums[1] = 2 + 7 = 9
Please write a function called
two_sumthat takes in an array of integersnumsand an integertarget, and returns a list of two indices that add up to the target.You can start by writing the function signature and any necessary imports.
student (to chat_manager):
Sure! Here's the function
two_sumthat solves the problem:Now, let's test the function with the given example:
Please run the code and let me know if the output is correct.
exitcode: 1 (execution failed)
Code output:
Traceback (most recent call last):
File "", line 3, in
result = two_sum(nums, target)
^^^^^^^
NameError: name 'two_sum' is not defined
teacher (to chat_manager):
It seems that there is a NameError because the function
two_sumis not defined. Let's fix this issue.Student, please make sure that the
two_sumfunction is defined before calling it. You can either move the function definition above the code that calls it or wrap the function definition and the code in a single cell.Once you have made the necessary changes, please run the code again and let me know if the output is correct.
student (to chat_manager):
Apologies for the mistake. Let me fix it by moving the function definition above the code that calls it. Here's the updated code:
Please run the code again and let me know if the output is correct.
exitcode: 0 (execution succeeded)
Code output:
[0, 1]
teacher (to chat_manager):
Great job, student! The code executed successfully and the output is correct. You have solved the first question correctly.
Now, let's move on to the second question:
Question 2:
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.
Example:
Input: "A man, a plan, a canal: Panama"
Output: True
Please write a function called
is_palindromethat takes in a stringsand returns a boolean value indicating whether the string is a palindrome or not.You can start by writing the function signature and any necessary imports.
student (to chat_manager):
Sure! Here's the function
is_palindromethat solves the problem:Now, let's test the function with the given example:
Please run the code and let me know if the output is correct.
exitcode: 1 (execution failed)
Code output:
Traceback (most recent call last):
File "", line 2, in
result = is_palindrome(s)
^^^^^^^^^^^^^
NameError: name 'is_palindrome' is not defined
teacher (to chat_manager):
It seems that there is a NameError because the function
is_palindromeis not defined. Let's fix this issue.Student, please make sure that the
is_palindromefunction is defined before calling it. You can either move the function definition above the code that calls it or wrap the function definition and the code in a single cell.Once you have made the necessary changes, please run the code again and let me know if the output is correct.
student (to chat_manager):
Apologies for the mistake. Let me fix it by moving the function definition above the code that calls it. Here's the updated code:
Please run the code again and let me know if the output is correct.
exitcode: 0 (execution succeeded)
Code output:
True
teacher (to chat_manager):
Well done, student! The code executed successfully and the output is correct. You have solved the second question correctly.
Now, let's move on to the third question:
Question 3:
Given a non-empty array of integers, every element appears twice except for one. Find that single element.
Example:
Input: [4, 1, 2, 1, 2]
Output: 4
Please write a function called
find_single_elementthat takes in a list of integersnumsand returns the single element that appears only once.You can start by writing the function signature and any necessary imports.
student (to chat_manager):
Sure! Here's the function
find_single_elementthat solves the problem:Now, let's test the function with the given example:
Please run the code and let me know if the output is correct.
exitcode: 1 (execution failed)
Code output:
Traceback (most recent call last):
File "", line 2, in
result = find_single_element(nums)
^^^^^^^^^^^^^^^^^^^
NameError: name 'find_single_element' is not defined
teacher (to chat_manager):
It seems that there is a NameError because the function
find_single_elementis not defined. Let's fix this issue.Student, please make sure that the
find_single_elementfunction is defined before calling it. You can either move the function definition above the code that calls it or wrap the function definition and the code in a single cell.Once you have made the necessary changes, please run the code again and let me know if the output is correct.
student (to chat_manager):
Apologies for the mistake. Let me fix it by moving the function definition above the code that calls it. Here's the updated code:
Please run the code again and let me know if the output is correct.
exitcode: 0 (execution succeeded)
Code output:
4
teacher (to chat_manager):
Well done, student! The code executed successfully and the output is correct. You have solved the third question correctly.
Now, let's move on to the fourth question:
Question 4:
Given a non-empty array of integers, every element appears three times except for one, which appears exactly once. Find that single element.
Example:
Input: [2, 2, 3, 2]
Output: 3
Please write a function called
find_single_elementthat takes in a list of integersnumsand returns the single element that appears only once.You can start by writing the function signature and any necessary imports.
student (to chat_manager):
Sure! Here's the function
find_single_elementthat solves the problem:Now, let's test the function with the given example:
Please run the code and let me know if the output is correct.
exitcode: 1 (execution failed)
Code output:
Traceback (most recent call last):
File "", line 2, in
result = find_single_element(nums)
^^^^^^^^^^^^^^^^^^^
NameError: name 'find_single_element' is not defined
teacher (to chat_manager):
It seems that there is a NameError because the function
find_single_elementis not defined. Let's fix this issue.Student, please make sure that the
find_single_elementfunction is defined before calling it. You can either move the function definition above the code that calls it or wrap the function definition and the code in a single cell.Once you have made the necessary changes, please run the code again and let me know if the output is correct.
student (to chat_manager):
Apologies for the mistake. Let me fix it by moving the function definition above the code that calls it. Here's the updated code:
Please run the code again and let me know if the output is correct.
exitcode: 0 (execution succeeded)
Code output:
3
teacher (to chat_manager):
Well done, student! The code executed successfully and the output is correct. You have solved the fourth question correctly.
Now, let's move on to the fifth and final question:
Question 5:
Given a non-empty array of integers, every element appears twice except for two, which appear exactly once. Find the two single elements.
Example:
Input: [1, 2, 1, 3, 2, 5]
Output: [3, 5]
Please write a function called
find_single_elementsthat takes in a list of integersnumsand returns a list of the two single elements that appear only once.You can start by writing the function signature and any necessary imports.
student (to chat_manager):
Sure! Here's the function
find_single_elementsthat solves the problem:Now, let's test the function with the given example:
Please run the code and let me know if the output is correct.
exitcode: 1 (execution failed)
Code output:
Traceback (most recent call last):
File "", line 2, in
result = find_single_elements(nums)
^^^^^^^^^^^^^^^^^^^^
NameError: name 'find_single_elements' is not defined
teacher (to chat_manager):
It seems that there is a NameError because the function
find_single_elementsis not defined. Let's fix this issue.Student, please make sure that the
find_single_elementsfunction is defined before calling it. You can either move the function definition above the code that calls it or wrap the function definition and the code in a single cell.Once you have made the necessary changes, please run the code again and let me know if the output is correct.
student (to chat_manager):
Apologies for the mistake. Let me fix it by moving the function definition above the code that calls it. Here's the updated code:
Please run the code again and let me know if the output is correct.
exitcode: 0 (execution succeeded)
Code output:
[3, 5]
teacher (to chat_manager):
Excellent job, student! The code executed successfully and the output is correct. You have successfully solved all 5 questions.
[COMPLETE]
Well done on completing the task! If you have any more questions or need further assistance, feel free to ask.
Admin (to chat_manager):
TERMINATE