Skip to content

Commit 62c724f

Browse files
Add initial text2sql code and notebooks (#2)
* Update dockerfile * Add basic entity file * Add a schema file for it * Add the sql plugin * Add the prompt and plugins * Add blank env * Update reqs * Update the template env * Add working example * Update sql prompt * Update the entities * Fix bug in sql plugin * Update rag script * add outputs * Update the plugins and entities * Fix sql outputs * Add notebook descriptions * Update the notebook for combined * README draft * Add sample output and tips * Update the main readme * Add the final readme * Add production considerations to the README * Add high level diagram
1 parent 597071a commit 62c724f

27 files changed

+2830
-457
lines changed

.devcontainer/Dockerfile

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
# Use the official Python image from Microsoft devcontainers
2-
FROM mcr.microsoft.com/devcontainers/python:3
3-
4-
# Install ODBC drivers and dependencies
5-
RUN apt-get update && \
6-
apt-get install -y apt-transport-https curl && \
7-
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && \
8-
curl https://packages.microsoft.com/config/debian/10/prod.list > /etc/apt/sources.list.d/mssql-release.list && \
9-
apt-get update && \
10-
ACCEPT_EULA=Y apt-get install -y msodbcsql18 unixodbc-dev
11-
12-
# Set the working directory
13-
WORKDIR /app
14-
15-
# Copy the requirements file into the container
16-
COPY requirements.txt .
17-
18-
# Install Python dependencies
19-
RUN pip install -r requirements.txt
1+
# Use the official Python image from Microsoft devcontainers
2+
FROM mcr.microsoft.com/devcontainers/python:3
3+
4+
# Install ODBC drivers and dependencies
5+
RUN apt-get update && \
6+
apt-get install -y apt-transport-https curl && \
7+
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && \
8+
curl https://packages.microsoft.com/config/debian/10/prod.list > /etc/apt/sources.list.d/mssql-release.list && \
9+
apt-get update && \
10+
ACCEPT_EULA=Y apt-get install -y msodbcsql18 unixodbc-dev
11+
12+
# Set the working directory
13+
WORKDIR /app
14+
15+
# Copy the requirements file into the container
16+
COPY requirements-dev.txt .
17+
18+
# Install Python dependencies
19+
RUN pip install -r requirements-dev.txt

.devcontainer/devcontainer.json

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
{
2-
"build": {
3-
"context": "..",
4-
"dockerfile": "Dockerfile"
5-
},
6-
"customizations": {
7-
"vscode": {
8-
"extensions": [
9-
"ms-python.python",
10-
"ms-python.vscode-pylance",
11-
"ms-toolsai.jupyter",
12-
"ms-azuretools.vscode-docker"
13-
],
14-
"settings": {
15-
"editor.formatOnSave": true
16-
}
17-
}
18-
},
19-
"features": {
20-
"ghcr.io/devcontainers-contrib/features/black:2": {}
21-
},
22-
"name": "Dev Container"
1+
{
2+
"build": {
3+
"context": "..",
4+
"dockerfile": "Dockerfile"
5+
},
6+
"customizations": {
7+
"vscode": {
8+
"extensions": [
9+
"ms-python.python",
10+
"ms-python.vscode-pylance",
11+
"ms-toolsai.jupyter",
12+
"ms-azuretools.vscode-docker"
13+
],
14+
"settings": {
15+
"editor.formatOnSave": true
16+
}
17+
}
18+
},
19+
"features": {
20+
"ghcr.io/devcontainers-contrib/features/black:2": {}
21+
},
22+
"name": "Dev Container"
2323
}

.github/CODEOWNERS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
# Default owner for everything in the repo
2-
* @microsoft/dstoolkit-text2sql-and-imageprocessing-admins
1+
# Default owner for everything in the repo
2+
* @microsoft/dstoolkit-text2sql-and-imageprocessing-admins

.github/dependabot.yaml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
version: 2
2-
updates:
3-
- package-ecosystem: "pip"
4-
directory: "/"
5-
schedule:
6-
interval: "weekly"
7-
commit-message:
8-
prefix: "deps"
9-
include: "scope"
10-
rebase-strategy: "auto"
11-
open-pull-requests-limit: 5
12-
labels:
13-
- "dependencies"
14-
- "automated-update"
1+
version: 2
2+
updates:
3+
- package-ecosystem: "pip"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
commit-message:
8+
prefix: "deps"
9+
include: "scope"
10+
rebase-strategy: "auto"
11+
open-pull-requests-limit: 5
12+
labels:
13+
- "dependencies"
14+
- "automated-update"
Lines changed: 73 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,73 @@
1-
# For most projects, this workflow file will not need changing; you simply need
2-
# to commit it to your repository.
3-
#
4-
# You may wish to alter this file to override the set of languages analyzed,
5-
# or to provide custom queries or build logic.
6-
#
7-
# ******** NOTE ********
8-
# We have attempted to detect the languages in your repository. Please check
9-
# the `language` matrix defined below to confirm you have the correct set of
10-
# supported CodeQL languages.
11-
#
12-
name: "CodeQL"
13-
14-
on:
15-
push:
16-
branches: [main]
17-
pull_request:
18-
# The branches below must be a subset of the branches above
19-
branches: [main]
20-
schedule:
21-
- cron: "38 19 * * 1"
22-
23-
permissions: read-all
24-
25-
jobs:
26-
analyze:
27-
name: Analyze
28-
runs-on: ubuntu-latest
29-
permissions:
30-
actions: read
31-
contents: read
32-
security-events: write
33-
34-
strategy:
35-
fail-fast: false
36-
matrix:
37-
language: ["python"]
38-
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
39-
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
40-
41-
steps:
42-
- name: Checkout repository
43-
uses: actions/checkout@v3
44-
45-
# Initializes the CodeQL tools for scanning.
46-
- name: Initialize CodeQL
47-
uses: github/codeql-action/init@v2
48-
with:
49-
languages: ${{ matrix.language }}
50-
# If you wish to specify custom queries, you can do so here or in a config file.
51-
# By default, queries listed here will override any specified in a config file.
52-
# Prefix the list here with "+" to use these queries and those in the config file.
53-
54-
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
55-
# queries: security-extended,security-and-quality
56-
57-
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
58-
# If this step fails, then you should remove it and run the build manually (see below)
59-
- name: Autobuild
60-
uses: github/codeql-action/autobuild@v2
61-
62-
# ℹ️ Command-line programs to run using the OS shell.
63-
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
64-
65-
# If the Autobuild fails above, remove it and uncomment the following three lines.
66-
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
67-
68-
# - run: |
69-
# echo "Run, Build Application using script"
70-
# ./location_of_script_within_repo/buildscript.sh
71-
72-
- name: Perform CodeQL Analysis
73-
uses: github/codeql-action/analyze@v2
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [main]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [main]
20+
schedule:
21+
- cron: "38 19 * * 1"
22+
23+
permissions: read-all
24+
25+
jobs:
26+
analyze:
27+
name: Analyze
28+
runs-on: ubuntu-latest
29+
permissions:
30+
actions: read
31+
contents: read
32+
security-events: write
33+
34+
strategy:
35+
fail-fast: false
36+
matrix:
37+
language: ["python"]
38+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
39+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
40+
41+
steps:
42+
- name: Checkout repository
43+
uses: actions/checkout@v3
44+
45+
# Initializes the CodeQL tools for scanning.
46+
- name: Initialize CodeQL
47+
uses: github/codeql-action/init@v2
48+
with:
49+
languages: ${{ matrix.language }}
50+
# If you wish to specify custom queries, you can do so here or in a config file.
51+
# By default, queries listed here will override any specified in a config file.
52+
# Prefix the list here with "+" to use these queries and those in the config file.
53+
54+
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
55+
# queries: security-extended,security-and-quality
56+
57+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
58+
# If this step fails, then you should remove it and run the build manually (see below)
59+
- name: Autobuild
60+
uses: github/codeql-action/autobuild@v2
61+
62+
# ℹ️ Command-line programs to run using the OS shell.
63+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
64+
65+
# If the Autobuild fails above, remove it and uncomment the following three lines.
66+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
67+
68+
# - run: |
69+
# echo "Run, Build Application using script"
70+
# ./location_of_script_within_repo/buildscript.sh
71+
72+
- name: Perform CodeQL Analysis
73+
uses: github/codeql-action/analyze@v2

0 commit comments

Comments
 (0)