diff --git a/LangChain/ChatWithDB/Dockerfile b/LangChain/ChatWithDB/Dockerfile index 50d6b1a..5d36bf0 100644 --- a/LangChain/ChatWithDB/Dockerfile +++ b/LangChain/ChatWithDB/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.10.14-slim +FROM python:3.12.3-slim # https://hub.docker.com/_/python # LABEL org.opencontainers.image.source https://github.com/JAlcocerT/Data-Chat diff --git a/LangChain/ChatWithDB/docker-compose.yml b/LangChain/ChatWithDB/docker-compose.yml new file mode 100644 index 0000000..5a8734b --- /dev/null +++ b/LangChain/ChatWithDB/docker-compose.yml @@ -0,0 +1,56 @@ +version: "3.8" + +services: + db: + image: mysql:8.0 + container_name: mysql_db + environment: + MYSQL_ROOT_PASSWORD: rootpassword + MYSQL_DATABASE: chinook + MYSQL_USER: myuser + MYSQL_PASSWORD: mypassword + ports: + - "3306:3306" # Expose MySQL on localhost:3306 + volumes: + - db_data:/var/lib/mysql # Persistent storage for database data + - ./init-scripts:/docker-entrypoint-initdb.d # Initialization scripts + command: > + bash -c "apt-get update && apt-get install -y wget && + wget -O /docker-entrypoint-initdb.d/Chinook_MySql.sql + https://github.com/lerocha/chinook-database/releases/download/v1.4.5/Chinook_MySql.sql && + docker-entrypoint.sh mysqld" + +volumes: + db_data: + +###docker exec -it mysql_db bash +###docker exec -it mysql_db mysql -u myuser -p chinook + + + +# version: "3.8" + +# services: +# db: +# image: mysql:8.0 +# container_name: mysql_db +# environment: +# MYSQL_ROOT_PASSWORD: rootpassword +# MYSQL_DATABASE: mydatabase +# MYSQL_USER: myuser +# MYSQL_PASSWORD: mypassword +# ports: +# - "3306:3306" # Expose MySQL on localhost:3306 +# volumes: +# - db_data:/var/lib/mysql # Persistent storage for database data + +# streamlit_app: +# image: python:3.11-slim +# container_name: streamlit_app +# working_dir: /app +# volumes: +# - .:/app # Mount local directory to container +# ports: +# - "8501:8501" # Expose Streamlit on localhost:8501 +# command: > +# bash -c "pip \ No newline at end of file diff --git a/LangChain/ChatWithDB/readme.md b/LangChain/ChatWithDB/readme.md index e1efeb9..2786373 100644 --- a/LangChain/ChatWithDB/readme.md +++ b/LangChain/ChatWithDB/readme.md @@ -9,6 +9,8 @@ Follow any of [these Python environment setup](https://jalcocert.github.io/JAlco For the `ipynb` vscode will ak you for the `ipykernel` module. +[![Open in Google Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/JAlcocerT/Data-Chat/blob/main/LangChain/ChatWithDB/test_langchainChatDB.ipynb) + Then you will be asked to **select the Python env**. You will need : https://platform.openai.com/api-keys diff --git a/LangChain/ChatWithDB/test_langchainChatDB.ipynb b/LangChain/ChatWithDB/test_langchainChatDB.ipynb index c38c314..f1daa62 100644 --- a/LangChain/ChatWithDB/test_langchainChatDB.ipynb +++ b/LangChain/ChatWithDB/test_langchainChatDB.ipynb @@ -22,7 +22,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "metadata": {}, "outputs": [ { @@ -42,7 +42,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 5, "metadata": {}, "outputs": [ { @@ -195,7 +195,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -814,7 +814,7 @@ ], "metadata": { "kernelspec": { - "display_name": "langchainChatDB_venv", + "display_name": "datachat_venv", "language": "python", "name": "python3" }, diff --git a/README.md b/README.md index a4778a7..33f2c9b 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ * in a docker container - as a server running your local machine or in the cloud * [ChatWithPDF Repo](https://github.com/JAlcocerT/ask-multiple-pdfs/) and Blog [Post](https://jalcocert.github.io/JAlcocerT/how-to-chat-with-pdfs/) * [ChatWithCSV Repo](https://github.com/JAlcocerT/langchain-ask-csv) and Blog [Post](https://jalcocert.github.io/JAlcocerT/how-to-chat-with-your-data/#chat-with-csv-with-langchain) - * ChatWithDB Blog [Post](https://jalcocert.github.io/JAlcocerT/how-to-chat-with-your-data/) - `./LangChain/ChatWithDB` + * ChatWithDB [Blog Post](https://jalcocert.github.io/JAlcocerT/how-to-chat-with-your-data/) - `./LangChain/ChatWithDB` * [**PandasAI**](https://jalcocert.github.io/JAlcocerT/how-to-use-pandasAI/) with * GroqAPI