Skip to content

Commit

Permalink
Data Eng AI
Browse files Browse the repository at this point in the history
  • Loading branch information
ashpreetbedi committed Apr 25, 2024
1 parent eadb91f commit 29cae00
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 145 deletions.
46 changes: 0 additions & 46 deletions cookbook/examples/autonomous/README.md

This file was deleted.

Empty file.
22 changes: 0 additions & 22 deletions cookbook/examples/autonomous/assistant.py

This file was deleted.

26 changes: 10 additions & 16 deletions cookbook/examples/data_eng/README.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,38 @@
# Data Engineering AI
# Data Engineering Examples

> Note: Fork and clone this repository if needed
1. Create a virtual environment
### Create a virtual environment

```shell
python3 -m venv ~/.venvs/aienv
source ~/.venvs/aienv/bin/activate
```

2. Install libraries
### 2. Install libraries

```shell
pip install -r cookbook/examples/data_eng/requirements.txt
```

3. Run Python Assistant
### 3. Run DuckDb Assistant

```shell
python cookbook/examples/data_eng/python_assistant.py
```

Ask:

```text
What is the average rating of movies?
python cookbook/examples/data_eng/duckdb_assistant.py
```

4. Run DuckDb Assistant
### 4. Run Python Assistant

```shell
python cookbook/examples/data_eng/duckdb_assistant.py
python cookbook/examples/data_eng/python_assistant.py
```

Ask:

```text
What is the average rating of movies? Show me the SQL.
What is the average rating of movies?
```

5. Message me on [discord](https://discord.gg/4MtYHHrgA8) if you have any questions
### 5. Message me on [discord](https://discord.gg/4MtYHHrgA8) if you have any questions

6. Star ⭐️ the project if you like it.
### 6. Star ⭐️ the project if you like it.
6 changes: 5 additions & 1 deletion cookbook/examples/data_eng/duckdb_assistant.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@
]
}
),
markdown=True,
show_tool_calls=True,
base_dir=Path(__file__).parent.joinpath("scratch"),
)

duckdb_assistant.cli_app(markdown=True)
# duckdb_assistant.cli_app()
duckdb_assistant.print_response("What is the average rating of movies? Show me the SQL?")
duckdb_assistant.print_response("Show me a histogram of movie ratings?")
duckdb_assistant.print_response("What are the top 5 movies?")
91 changes: 31 additions & 60 deletions cookbook/examples/data_eng/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile --strip-extras cookbook/examples/data_eng/requirements.in
# pip-compile cookbook/examples/data_eng/requirements.in
#
altair==5.2.0
altair==5.3.0
# via streamlit
annotated-types==0.6.0
# via pydantic
Expand All @@ -18,14 +18,7 @@ attrs==23.2.0
# referencing
blinker==1.7.0
# via streamlit
boto3==1.34.45
# via phidata
botocore==1.34.45
# via
# boto3
# phidata
# s3transfer
cachetools==5.3.2
cachetools==5.3.3
# via streamlit
certifi==2024.2.2
# via
Expand All @@ -40,39 +33,31 @@ click==8.1.7
# typer
distro==1.9.0
# via openai
docker==7.0.0
# via phidata
duckdb==0.10.0
duckdb==0.10.2
# via -r cookbook/examples/data_eng/requirements.in
gitdb==4.0.11
# via gitpython
gitpython==3.1.42
gitpython==3.1.43
# via
# phidata
# streamlit
h11==0.14.0
# via httpcore
httpcore==1.0.3
httpcore==1.0.5
# via httpx
httpx==0.26.0
httpx==0.27.0
# via
# openai
# phidata
idna==3.6
idna==3.7
# via
# anyio
# httpx
# requests
importlib-metadata==7.0.1
# via streamlit
jinja2==3.1.3
# via
# altair
# pydeck
jmespath==1.0.1
# via
# boto3
# botocore
jsonschema==4.21.1
# via altair
jsonschema-specifications==2023.12.1
Expand All @@ -90,44 +75,40 @@ numpy==1.26.4
# pyarrow
# pydeck
# streamlit
openai==1.12.0
openai==1.23.6
# via -r cookbook/examples/data_eng/requirements.in
packaging==23.2
packaging==24.0
# via
# altair
# docker
# streamlit
pandas==2.2.0
pandas==2.2.2
# via
# -r cookbook/examples/data_eng/requirements.in
# altair
# streamlit
phidata==2.3.83
# via -r cookbook/examples/data_eng/requirements.in
pillow==10.2.0
pillow==10.3.0
# via streamlit
protobuf==4.25.3
# via streamlit
pyarrow==15.0.0
pyarrow==16.0.0
# via streamlit
pydantic==2.6.1
pydantic==2.7.1
# via
# openai
# phidata
# pydantic-settings
pydantic-core==2.16.2
pydantic-core==2.18.2
# via pydantic
pydantic-settings==2.2.1
# via phidata
pydeck==0.8.1b0
pydeck==0.9.0b0
# via streamlit
pygments==2.17.2
# via rich
python-dateutil==2.8.2
# via
# botocore
# pandas
# streamlit
python-dateutil==2.9.0.post0
# via pandas
python-dotenv==1.0.1
# via
# phidata
Expand All @@ -136,36 +117,35 @@ pytz==2024.1
# via pandas
pyyaml==6.0.1
# via phidata
referencing==0.33.0
referencing==0.35.0
# via
# jsonschema
# jsonschema-specifications
requests==2.31.0
# via
# docker
# streamlit
rich==13.7.0
# via streamlit
rich==13.7.1
# via
# phidata
# streamlit
# typer
rpds-py==0.18.0
# via
# jsonschema
# referencing
s3transfer==0.10.0
# via boto3
shellingham==1.5.4
# via typer
six==1.16.0
# via python-dateutil
smmap==5.0.1
# via gitdb
sniffio==1.3.0
sniffio==1.3.1
# via
# anyio
# httpx
# openai
sqlalchemy==2.0.27
sqlalchemy==2.0.29
# via -r cookbook/examples/data_eng/requirements.in
streamlit==1.31.1
streamlit==1.33.0
# via -r cookbook/examples/data_eng/requirements.in
tenacity==8.2.3
# via streamlit
Expand All @@ -179,9 +159,9 @@ tornado==6.4
# via streamlit
tqdm==4.66.2
# via openai
typer==0.9.0
typer==0.12.3
# via phidata
typing-extensions==4.9.0
typing-extensions==4.11.0
# via
# openai
# phidata
Expand All @@ -192,14 +172,5 @@ typing-extensions==4.9.0
# typer
tzdata==2024.1
# via pandas
tzlocal==5.2
# via streamlit
urllib3==2.0.7
# via
# botocore
# docker
# requests
validators==0.22.0
# via streamlit
zipp==3.17.0
# via importlib-metadata
urllib3==2.2.1
# via requests

0 comments on commit 29cae00

Please sign in to comment.