-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Add "py" as lang in conversable agent (#1062) #2144
Conversation
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.
- Update the function here also:
Line 246 in c8aca8d
def _cmd(lang: str) -> str: py
andPython
, converting them topython
. - Update unit tests to handle
py
,Python
, andpython
: https://github.com/microsoft/autogen/blob/main/test/coding/test_commandline_code_executor.py#L66
@microsoft-github-policy-service agree |
@ekzhu Thankyou for the pointers. Second commit is to revert an accidental import. It looks good now. In addition to your suggestion I had to add the condition here, in order to pass tests: 99a2a11#diff-7e1e6bfc49ab6dff4b52ba5677edcda6aff4ae436001c46cecd45847d4d71caeR119-R120 |
Thanks~ This PR is also related to the issue #2096 I made updates to the Gemini branch but not the main branch. This update will be good for many other models. |
@ekzhu this PR is blocked by your change request. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2144 +/- ##
==========================================
+ Coverage 38.14% 39.07% +0.92%
==========================================
Files 78 78
Lines 7865 7883 +18
Branches 1683 1825 +142
==========================================
+ Hits 3000 3080 +80
+ Misses 4615 4539 -76
- Partials 250 264 +14
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.
Thanks. This can be improved by using parametetrized pytest decorators. You can create a separate PR for this.
# content of test_math.py
import pytest
def calculate_square(number):
return number ** 2
@pytest.mark.parametrize("input_number, expected_result", [
(2, 4), # Test case 1: Input 2, expect 4
(3, 9), # Test case 2: Input 3, expect 9
(0, 0), # Test case 3: Input 0, expect 0
(-5, 25) # Test case 4: Input -5, expect 25
])
def test_calculate_square(input_number, expected_result):
result = calculate_square(input_number)
assert result == expected_result
Co-authored-by: Eric Zhu <[email protected]>
) Co-authored-by: Eric Zhu <[email protected]>
Run |
Done. |
* Add "py" as lang in conversable agent (microsoft#1062) * Add conditions to allow for python executable variants (microsoft#1062) * reverted import (microsoft#1062) * Parameterized tests, moved Python variants to a constant (microsoft#1062) * Moved Python variants to a constant (microsoft#1062) * Update autogen/code_utils.py (microsoft#1062) Co-authored-by: Eric Zhu <[email protected]> * Update autogen/coding/local_commandline_code_executor.py (microsoft#1062) Co-authored-by: Eric Zhu <[email protected]> * Added PYTHON_VARIANTS as imported constant (microsoft#1062) * ran pre-commit-check (microsoft#1062) --------- Co-authored-by: Chi Wang <[email protected]> Co-authored-by: Eric Zhu <[email protected]>
Why are these changes needed?
Adds "py" string to conditional in conversable_agent, in order to execute code blocks.
Related issue number
Closes #1062
Checks
Please let me know if there are any issues with this PR, still new to OS development.