-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Added ability to specify 'role' field for select speaker messages for Group Chats (addresses #1861) #2167
Conversation
…hat in conversation patterns
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2167 +/- ##
===========================================
+ Coverage 37.98% 49.22% +11.23%
===========================================
Files 75 75
Lines 7589 7580 -9
Branches 1636 1766 +130
===========================================
+ Hits 2883 3731 +848
+ Misses 4463 3543 -920
- Partials 243 306 +63
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this change set is based off an older version of main. Can you base the changes from the latest main? Also, since the group chat change would require running OAI tests so can you start a new PR using a branch from the microsoft repo?
@@ -716,7 +716,7 @@ def _print_received_message(self, message: Union[Dict, str], sender: Agent): | |||
if "function_call" in message and message["function_call"]: | |||
function_call = dict(message["function_call"]) | |||
func_print = ( | |||
f"***** Suggested function call: {function_call.get('name', '(No function name found)')} *****" | |||
f"***** Suggested function Call: {function_call.get('name', '(No function name found)')} *****" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
f"***** Suggested function Call: {function_call.get('name', '(No function name found)')} *****" | |
f"***** Suggested function call: {function_call.get('name', '(No function name found)')} *****" |
@@ -728,7 +728,7 @@ def _print_received_message(self, message: Union[Dict, str], sender: Agent): | |||
iostream.print(colored("*" * len(func_print), "green"), flush=True) | |||
if "tool_calls" in message and message["tool_calls"]: | |||
for tool_call in message["tool_calls"]: | |||
id = tool_call.get("id", "No tool call id found") | |||
id = tool_call.get("id", "(No id found)") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
id = tool_call.get("id", "(No id found)") | |
id = tool_call.get("id", "No tool_call_id found") |
@@ -1311,12 +1311,6 @@ def _generate_oai_reply_from_client(self, llm_client, messages, cache) -> Union[ | |||
) | |||
for tool_call in extracted_response.get("tool_calls") or []: | |||
tool_call["function"]["name"] = self._normalize_name(tool_call["function"]["name"]) | |||
# Remove id and type if they are not present. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These were for Mistral AI compatibility. Are these not needed now?
Closing this PR as it was based on an older version of main. New PR #2199 |
… Group Chats (Replaces PR #2167) (#2199) * Re-commit of code from PR (#2167) addressing #1861, due to wrong basing * Update website/docs/topics/non-openai-models/best-tips-for-nonopenai-models.md Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com> * Removed unnecessary notebook images * Update conversation-patterns.ipynb Updated to include note about being applicable when auto. * Updated to include checks that the role is not blank/None. Added tests. * Changed try-except to use pytest --------- Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
… Group Chats (Replaces PR microsoft#2167) (microsoft#2199) * Re-commit of code from PR (microsoft#2167) addressing microsoft#1861, due to wrong basing * Update website/docs/topics/non-openai-models/best-tips-for-nonopenai-models.md Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com> * Removed unnecessary notebook images * Update conversation-patterns.ipynb Updated to include note about being applicable when auto. * Updated to include checks that the role is not blank/None. Added tests. * Changed try-except to use pytest --------- Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
Why are these changes needed?
As per feature request #1861 ("[Feature Request]: Allowing user to specify the "role" field for select speaker messages"), this PR includes changes to the GroupChat constructor to allow the user to specify the role for the select speaker messages. This addresses the issue of role names when using Mistral through Mistral.AI's API.
Changes:
role_for_select_speaker_messages
toGroupChat
constructor ingroupchat.py
Related issue number
Addresses #1861
Checks