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

feat: add schema-linking awel example #1081

Merged
merged 3 commits into from
Jan 21, 2024

Conversation

junewgl
Copy link
Collaborator

@junewgl junewgl commented Jan 17, 2024

Description

feat: add schemalinking awel example:nl -> schema -> sql -> chart

How Has This Been Tested?

pre-requirements:
1. install openai python sdk
pip install -e ."[openai]"
2. set openai key and base
export OPENAI_API_KEY={your_openai_key} export OPENAI_API_BASE={your_openai_base}
or
import os os.environ["OPENAI_API_KEY"] = {your_openai_key} os.environ["OPENAI_API_BASE"] = {your_openai_base}
3. run
python examples/awel/simple_nl_schema_sql_chart_example.py
Examples:

curl --location 'http://127.0.0.1:5555/api/v1/awel/trigger/examples/rag/schema_linking' \
--header 'Content-Type: application/json' \
--data '{"query": "Statistics of user age in the user table are based on three categories: age is less than 10, age is greater than or equal to 10 and less than or equal to 20, and age is greater than 20. The first column of the statistical results is different ages, and the second column is count."}' 

Snapshots:

  • data
    image
  • run
    image
  • sql
    image
  • chart
    image

Checklist:

  • My code follows the style guidelines of this project
  • I have already rebased the commits and make the commit message conform to the project standard.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • Any dependent changes have been merged and published in downstream modules

@github-actions github-actions bot added the enhancement New feature or request label Jan 17, 2024
@Aries-ckt Aries-ckt changed the title feat: add schemalinking awel example feat: add schema-linking awel example Jan 17, 2024
Aries-ckt
Aries-ckt previously approved these changes Jan 17, 2024
Copy link
Collaborator

@Aries-ckt Aries-ckt left a comment

Choose a reason for hiding this comment

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

r+

@csunny
Copy link
Collaborator

csunny commented Jan 17, 2024

Thanks for your PR at first, but i noticed that you created a new schemalinker package and put it in the rags directory. Why are the sql_exec.py and sql_gen.py files also put here?

Schemalinking will be a very critical capability in dbgpt and requires a detailed plan. The current implementation is more like an example, and the directory needs to be adjusted.

Don’t merge for now, please. @Aries-ckt

qidanrui
qidanrui previously approved these changes Jan 17, 2024
@junewgl
Copy link
Collaborator Author

junewgl commented Jan 17, 2024

Thanks for your PR at first, but i noticed that you created a new schemalinker package and put it in the rags directory. Why are the sql_exec.py and sql_gen.py files also put here?

Schemalinking will be a very critical capability in dbgpt and requires a detailed plan. The current implementation is more like an example, and the directory needs to be adjusted.

Don’t merge for now, please. @Aries-ckt

Thanks for your suggestion, I will revise it again @csunny

@junewgl junewgl dismissed stale reviews from qidanrui and Aries-ckt via 9e08028 January 18, 2024 09:35
Copy link
Collaborator

@csunny csunny left a comment

Choose a reason for hiding this comment

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

r+

@junewgl junewgl requested a review from Aries-ckt January 19, 2024 02:30
Copy link
Collaborator

@Aries-ckt Aries-ckt left a comment

Choose a reason for hiding this comment

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

r+

@csunny csunny merged commit 4f83363 into eosphoros-ai:main Jan 21, 2024
Hopshine pushed a commit to Hopshine/DB-GPT that referenced this pull request Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants