Skip to content
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

Extact_code can detect single-line code now #2

Merged
merged 8 commits into from
Sep 21, 2023
Merged

Extact_code can detect single-line code now #2

merged 8 commits into from
Sep 21, 2023

Conversation

BeibinLi
Copy link
Collaborator

@BeibinLi BeibinLi commented Sep 19, 2023

Why are these changes needed?

A parameter is added. Default to False.
When True, it will also detect single-line code.

For instance,
data = """

hello, how are you.

You can run python main.py

Or, you can write

1 + 1 == 2
print(3)
Formated stuff here
and there

Otherwise, do source download.sh for it.

I would also want to extract variable x.

Is that ok?
"""

extract_code(data, detect_single_line_code=True)

We will get

[('UNKNOWN', 'python main.py'),
 ('python', '1 + 1 == 2\nprint(3)'),
 ('UNKNOWN', 'Formated stuff here\nand there'),
 ('UNKNOWN', 'source download.sh'),
 ('UNKNOWN', 'x')]

Related issue number

Checks

@codecov-commenter
Copy link

codecov-commenter commented Sep 19, 2023

Codecov Report

Merging #2 (fa696dd) into main (6f54631) will increase coverage by 33.39%.
Report is 5 commits behind head on main.
The diff coverage is 92.30%.

@@             Coverage Diff             @@
##             main       #2       +/-   ##
===========================================
+ Coverage   34.22%   67.62%   +33.39%     
===========================================
  Files          17       17               
  Lines        1911     1921       +10     
  Branches      416      453       +37     
===========================================
+ Hits          654     1299      +645     
+ Misses       1207      516      -691     
- Partials       50      106       +56     
Flag Coverage Δ
unittests 67.41% <92.30%> (+33.24%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
autogen/code_utils.py 94.83% <92.30%> (+51.48%) ⬆️

... and 8 files with indirect coverage changes

@sonichi
Copy link
Contributor

sonichi commented Sep 19, 2023

Could you add test to cover the new code?

@sonichi sonichi requested a review from a team September 19, 2023 17:30
Copy link
Contributor

@pcdeadeasy pcdeadeasy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please address the suggestion to add the comment

@BeibinLi
Copy link
Collaborator Author

@sonichi @pcdeadeasy

  1. Comments added.
  2. Test case added/modified.

autogen/code_utils.py Outdated Show resolved Hide resolved
Copy link
Contributor

@pcdeadeasy pcdeadeasy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@sonichi sonichi requested review from qingyun-wu and a team September 21, 2023 01:00
@sonichi sonichi temporarily deployed to openai September 21, 2023 16:02 — with GitHub Actions Inactive
@sonichi sonichi temporarily deployed to openai September 21, 2023 16:02 — with GitHub Actions Inactive
@sonichi sonichi temporarily deployed to openai September 21, 2023 16:02 — with GitHub Actions Inactive
@sonichi sonichi added this pull request to the merge queue Sep 21, 2023
Merged via the queue into main with commit 3627ca4 Sep 21, 2023
19 checks passed
@sonichi sonichi deleted the extract_code branch September 22, 2023 03:43
@miiiz miiiz mentioned this pull request Oct 31, 2023
3 tasks
@h1-tkalahan h1-tkalahan mentioned this pull request Dec 6, 2023
github-merge-queue bot pushed a commit that referenced this pull request Dec 27, 2023
#925)

* Filter out candidates with the same name but different instructions, file IDs, and function names

* polish

* improve log

* improving log

* improve log

* Improve function signature (#2)

* try to fix ci

* try to fix ci

---------

Co-authored-by: gagb <gagb@users.noreply.github.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
@marklysze marklysze mentioned this pull request Mar 4, 2024
3 tasks
whiskyboy pushed a commit to whiskyboy/autogen that referenced this pull request Apr 17, 2024
* Extact_code can detect single-line code now

* Add comments for RE

* Add test case and adjust UNKNOWN behavior

* Remove tmp test files

* Update autogen/code_utils.py

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
whiskyboy pushed a commit to whiskyboy/autogen that referenced this pull request Apr 17, 2024
microsoft#925)

* Filter out candidates with the same name but different instructions, file IDs, and function names

* polish

* improve log

* improving log

* improve log

* Improve function signature (microsoft#2)

* try to fix ci

* try to fix ci

---------

Co-authored-by: gagb <gagb@users.noreply.github.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
randombet pushed a commit to randombet/autogen that referenced this pull request Sep 26, 2024
…sted chat (speaker_selection_method='auto') (microsoft#2)

* Initial commit with ability to add transforms to GroupChat

* Added tests

* Tidy up

* Tidy up of variable names and commented out test

* Tidy up comment

* Update import to relative

* Added documentation topic for transform messages for speaker selection.

* Formatting for test_groupchat.py

* Further formatting on test_groupchat.py

* Tweak to test

* Added Long Context Handling to tag for documentation

---------

Co-authored-by: Li Jiang <bnujli@gmail.com>
Co-authored-by: Qingyun Wu <qingyun0327@gmail.com>
Co-authored-by: Chi Wang <4250911+sonichi@users.noreply.github.com>
jackgerrits pushed a commit that referenced this pull request Oct 2, 2024
Skills refactor, CLI calls local kernel
jackgerrits pushed a commit that referenced this pull request Oct 2, 2024
jackgerrits added 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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants