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

Add SQL agent and Spider environment #1218

Merged
merged 13 commits into from
Jan 27, 2024
Merged

Add SQL agent and Spider environment #1218

merged 13 commits into from
Jan 27, 2024

Conversation

byronxu99
Copy link
Collaborator

@byronxu99 byronxu99 commented Jan 12, 2024

Why are these changes needed?

This PR adds a notebook that shows how to use Autogen for natural lanugage to SQL. It uses a text-to-SQL benchmark called Spider, which can be installed as a pip package.

Related issue number

None

Checks

@rickyloynd-microsoft
Copy link
Contributor

Hi @byronxu99 Can you provide details about this SQL agent and Spider environment, as well as their benefits? The test dir is generally reserved for test scripts to be run by pytest or by users. New agents generally belong under agentchat/contrib.

@zwd-ms
Copy link
Contributor

zwd-ms commented Jan 12, 2024

Hi @byronxu99 Can you provide details about this SQL agent and Spider environment, as well as their benefits? The test dir is generally reserved for test scripts to be run by pytest or by users. New agents generally belong under agentchat/contrib.

Hi @rickyloynd-microsoft I moved the agent into the notebook directory as an example, hopefully that's a better place.

@codecov-commenter
Copy link

codecov-commenter commented Jan 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (fd0094c) 32.48% compared to head (5274ade) 32.48%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1218   +/-   ##
=======================================
  Coverage   32.48%   32.48%           
=======================================
  Files          41       41           
  Lines        4907     4907           
  Branches     1120     1120           
=======================================
  Hits         1594     1594           
  Misses       3187     3187           
  Partials      126      126           
Flag Coverage Δ
unittests 32.44% <ø> (ø)

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rickyloynd-microsoft
Copy link
Contributor

Hi @byronxu99 Can you provide details about this SQL agent and Spider environment, as well as their benefits? The test dir is generally reserved for test scripts to be run by pytest or by users. New agents generally belong under agentchat/contrib.

Hi @rickyloynd-microsoft I moved the agent into the notebook directory as an example, hopefully that's a better place.

Yes, it's simpler. Is this PR just adding a notebook example of how to use SpiderEnv through function calling and SQL? The loop at the bottom of the nb would be convenient if it were inside a .py file, but in the nb it would be better to replace the for loop with a few example turns to illustrate and document the responses that are expected. The other notebooks are organized this way.

Where is spider_env defined? Did that file get dropped from the PR?

At the top of the PR, there should be some explanation of the benefits. ("Why are these changes needed?")

@afourney
Copy link
Member

afourney commented Jan 12, 2024

Is this the Spider nl2sql benchmark? That would probably fit better under autogenbench

@byronxu99
Copy link
Collaborator Author

@rickyloynd-microsoft
Hi, we have updated the notebook and PR description. spider_env is a Python pip package, and the notebook provides the command for installing it.

@afourney
This PR will just be the demo notebook. Any integration with autogenbench would be for future work.

The PR should now be ready to be merged.

@byronxu99 byronxu99 marked this pull request as ready for review January 25, 2024 18:59
Copy link
Contributor

@rickyloynd-microsoft rickyloynd-microsoft 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!

@afourney afourney self-requested a review January 25, 2024 22:19
Copy link
Member

@afourney afourney left a comment

Choose a reason for hiding this comment

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

LGTM

@sonichi
Copy link
Contributor

sonichi commented Jan 26, 2024

Could you add a link in https://microsoft.github.io/autogen/docs/Examples ? That will help with the discoverability.

@BeibinLi
Copy link
Collaborator

I am okay with this notebook. However, the agent is designed for "Spider" benchmark, which is not used generally for actual product. For instance, when users want to use a SQL agent, they would not expect to give "reward" or "score" for the answer, as they may not even know the answer.

So, I would suggest to include the name "spider" into the notebook file name.

@byronxu99
Copy link
Collaborator Author

@sonichi @BeibinLi
The requested changes have been made.

Copy link
Collaborator

@BeibinLi BeibinLi left a comment

Choose a reason for hiding this comment

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

LGTM now~ Thanks!

@sonichi sonichi added this pull request to the merge queue Jan 27, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 27, 2024
website/docs/Examples.md Outdated Show resolved Hide resolved
@sonichi sonichi added this pull request to the merge queue Jan 27, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 27, 2024
@sonichi sonichi added this pull request to the merge queue Jan 27, 2024
Merged via the queue into microsoft:main with commit fe7876d Jan 27, 2024
19 checks passed
corleroux pushed a commit to corleroux/autogen that referenced this pull request Jan 30, 2024
* add SQL agent and Spider environment

* Make a notebook. Clean up environment.

* add SQL agent and Spider environment

* Make a notebook. Clean up environment.

* clarify that sql agent is for spider environment

* add link to notebook in docs

* Update doc.

---------

Co-authored-by: Wangda Zhang <[email protected]>
Co-authored-by: Beibin Li <[email protected]>
Co-authored-by: Chi Wang <[email protected]>
whiskyboy pushed a commit to whiskyboy/autogen that referenced this pull request Apr 17, 2024
* add SQL agent and Spider environment

* Make a notebook. Clean up environment.

* add SQL agent and Spider environment

* Make a notebook. Clean up environment.

* clarify that sql agent is for spider environment

* add link to notebook in docs

* Update doc.

---------

Co-authored-by: Wangda Zhang <[email protected]>
Co-authored-by: Beibin Li <[email protected]>
Co-authored-by: Chi Wang <[email protected]>
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.

None yet

7 participants