Giter Site home page Giter Site logo

text2sql's Introduction

Text2SQL

配置参数

模型配置/大模型API、数据库连接信息

连接到数据库,获取所有表的列名和数据类型,作为prompt的一部分

用户输入自然语言查询

  • 3.1 大模型基于"数据库信息+自然语言查询"生成sql语句
  • 3.2 验证sql的有效性
  1. 能否执行: 大模型check/数据库执行测试/建模判断
  2. 是否是用户想要的: 执行一次大模型,给当前sql的一个注释,判断注释和用户输入是否一致
  • 3.3 支持用户修改,用户确认后执行,返回结果

参考:

  1. https://github.com/HarryVolek/aisql/blob/main/aisql.go
  2. langchain sql: https://langchain.readthedocs.io/en/latest/modules/chains/examples/sqlite.html?highlight=sql
  3. gpt-index, sql解决方案, https://gpt-index.readthedocs.io/en/latest/guides/sql_guide.html

text2sql's People

Contributors

enjoysport2022 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.