AXZ91 commited on
Commit
aa6d548
Β·
1 Parent(s): 7e99877

Upload 14 files

Browse files
Files changed (12) hide show
  1. .gcloudignore +158 -0
  2. .gitignore +156 -0
  3. LICENSE +21 -0
  4. app.yaml +43 -0
  5. chainlit.md +24 -0
  6. cloudbuild.yaml +22 -0
  7. docker-compose.yml +10 -0
  8. poetry.lock +0 -0
  9. poetry.toml +3 -0
  10. pyproject.toml +20 -0
  11. requirements.txt +4 -0
  12. ui.PNG +0 -0
.gcloudignore ADDED
@@ -0,0 +1,158 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Local data
2
+ data/local_data/
3
+
4
+ # Secrets
5
+ .streamlit/secrets.toml
6
+
7
+ # VSCode
8
+ .vscode/
9
+
10
+ # TODO
11
+ TODO.md
12
+
13
+ # Byte-compiled / optimized / DLL files
14
+ __pycache__/
15
+ *.py[cod]
16
+ *$py.class
17
+
18
+ # C extensions
19
+ *.so
20
+
21
+ # Distribution / packaging
22
+ .Python
23
+ build/
24
+ develop-eggs/
25
+ dist/
26
+ downloads/
27
+ eggs/
28
+ .eggs/
29
+ lib/
30
+ lib64/
31
+ parts/
32
+ sdist/
33
+ var/
34
+ wheels/
35
+ share/python-wheels/
36
+ *.egg-info/
37
+ .installed.cfg
38
+ *.egg
39
+ MANIFEST
40
+
41
+ # PyInstaller
42
+ # Usually these files are written by a python script from a template
43
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
44
+ *.manifest
45
+ *.spec
46
+
47
+ # Installer logs
48
+ pip-log.txt
49
+ pip-delete-this-directory.txt
50
+
51
+ # Unit test / coverage reports
52
+ htmlcov/
53
+ .tox/
54
+ .nox/
55
+ .coverage
56
+ .coverage.*
57
+ .cache
58
+ nosetests.xml
59
+ coverage.xml
60
+ *.cover
61
+ *.py,cover
62
+ .hypothesis/
63
+ .pytest_cache/
64
+ cover/
65
+
66
+ # Translations
67
+ *.mo
68
+ *.pot
69
+
70
+ # Django stuff:
71
+ *.log
72
+ local_settings.py
73
+ db.sqlite3
74
+ db.sqlite3-journal
75
+
76
+ # Flask stuff:
77
+ instance/
78
+ .webassets-cache
79
+
80
+ # Scrapy stuff:
81
+ .scrapy
82
+
83
+ # Sphinx documentation
84
+ docs/_build/
85
+
86
+ # PyBuilder
87
+ .pybuilder/
88
+ target/
89
+
90
+ # Jupyter Notebook
91
+ .ipynb_checkpoints
92
+
93
+ # IPython
94
+ profile_default/
95
+ ipython_config.py
96
+
97
+ # pdm
98
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
99
+ #pdm.lock
100
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
101
+ # in version control.
102
+ # https://pdm.fming.dev/#use-with-ide
103
+ .pdm.toml
104
+
105
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
106
+ __pypackages__/
107
+
108
+ # Celery stuff
109
+ celerybeat-schedule
110
+ celerybeat.pid
111
+
112
+ # SageMath parsed files
113
+ *.sage.py
114
+
115
+ # Environments
116
+ .env
117
+ .venv
118
+ env/
119
+ venv/
120
+ ENV/
121
+ env.bak/
122
+ venv.bak/
123
+
124
+ # Spyder project settings
125
+ .spyderproject
126
+ .spyproject
127
+
128
+ # Rope project settings
129
+ .ropeproject
130
+
131
+ # mkdocs documentation
132
+ /site
133
+
134
+ # mypy
135
+ .mypy_cache/
136
+ .dmypy.json
137
+ dmypy.json
138
+
139
+ # Pyre type checker
140
+ .pyre/
141
+
142
+ # pytype static type analyzer
143
+ .pytype/
144
+
145
+ # Cython debug symbols
146
+ cython_debug/
147
+
148
+ # PyCharm
149
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
150
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
151
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
152
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
153
+ .idea/
154
+ .idea
155
+ .gcloudignore
156
+ credentials.json
157
+ token.json
158
+
.gitignore ADDED
@@ -0,0 +1,156 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Local data
2
+ data/local_data/
3
+
4
+ # Secrets
5
+ .streamlit/secrets.toml
6
+
7
+ # VSCode
8
+ .vscode/
9
+
10
+ # TODO
11
+ TODO.md
12
+
13
+ # Byte-compiled / optimized / DLL files
14
+ __pycache__/
15
+ *.py[cod]
16
+ *$py.class
17
+
18
+ # C extensions
19
+ *.so
20
+
21
+ # Distribution / packaging
22
+ .Python
23
+ build/
24
+ develop-eggs/
25
+ dist/
26
+ downloads/
27
+ eggs/
28
+ .eggs/
29
+ lib/
30
+ lib64/
31
+ parts/
32
+ sdist/
33
+ var/
34
+ wheels/
35
+ share/python-wheels/
36
+ *.egg-info/
37
+ .installed.cfg
38
+ *.egg
39
+ MANIFEST
40
+
41
+ # PyInstaller
42
+ # Usually these files are written by a python script from a template
43
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
44
+ *.manifest
45
+ *.spec
46
+
47
+ # Installer logs
48
+ pip-log.txt
49
+ pip-delete-this-directory.txt
50
+
51
+ # Unit test / coverage reports
52
+ htmlcov/
53
+ .tox/
54
+ .nox/
55
+ .coverage
56
+ .coverage.*
57
+ .cache
58
+ nosetests.xml
59
+ coverage.xml
60
+ *.cover
61
+ *.py,cover
62
+ .hypothesis/
63
+ .pytest_cache/
64
+ cover/
65
+
66
+ # Translations
67
+ *.mo
68
+ *.pot
69
+
70
+ # Django stuff:
71
+ *.log
72
+ local_settings.py
73
+ db.sqlite3
74
+ db.sqlite3-journal
75
+
76
+ # Flask stuff:
77
+ instance/
78
+ .webassets-cache
79
+
80
+ # Scrapy stuff:
81
+ .scrapy
82
+
83
+ # Sphinx documentation
84
+ docs/_build/
85
+
86
+ # PyBuilder
87
+ .pybuilder/
88
+ target/
89
+
90
+ # Jupyter Notebook
91
+ .ipynb_checkpoints
92
+
93
+ # IPython
94
+ profile_default/
95
+ ipython_config.py
96
+
97
+ # pdm
98
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
99
+ #pdm.lock
100
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
101
+ # in version control.
102
+ # https://pdm.fming.dev/#use-with-ide
103
+ .pdm.toml
104
+
105
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
106
+ __pypackages__/
107
+
108
+ # Celery stuff
109
+ celerybeat-schedule
110
+ celerybeat.pid
111
+
112
+ # SageMath parsed files
113
+ *.sage.py
114
+
115
+ # Environments
116
+ .env
117
+ .venv
118
+ env/
119
+ venv/
120
+ ENV/
121
+ env.bak/
122
+ venv.bak/
123
+
124
+ # Spyder project settings
125
+ .spyderproject
126
+ .spyproject
127
+
128
+ # Rope project settings
129
+ .ropeproject
130
+
131
+ # mkdocs documentation
132
+ /site
133
+
134
+ # mypy
135
+ .mypy_cache/
136
+ .dmypy.json
137
+ dmypy.json
138
+
139
+ # Pyre type checker
140
+ .pyre/
141
+
142
+ # pytype static type analyzer
143
+ .pytype/
144
+
145
+ # Cython debug symbols
146
+ cython_debug/
147
+
148
+ # PyCharm
149
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
150
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
151
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
152
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
153
+ .idea/
154
+ credentials.json
155
+ token.json
156
+
LICENSE ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MIT License
2
+
3
+ Copyright (c) 2023 DR. AMJAD RAZA
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
app.yaml ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright 2021 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ #---------------------------------------------------------------
16
+ #runtime: python
17
+ #env: flex
18
+ #entrypoint: streamlit run -b pandasai_app/main.py
19
+ #
20
+ #runtime_config:
21
+ # operating_system: ubuntu22
22
+ #---------------------------------------------------------------
23
+
24
+ # With Dockerfile
25
+ runtime: custom
26
+ env: flex
27
+
28
+ # This sample incurs costs to run on the App Engine flexible environment.
29
+ # The settings below are to reduce costs during testing and are not appropriate
30
+ # for production use. For more information, see:
31
+ # https://cloud.google.com/appengine/docs/flexible/python/configuring-your-app-with-app-yaml
32
+
33
+ #network:
34
+ # forwarded_ports:
35
+ # - 8501/tcp
36
+
37
+ manual_scaling:
38
+ instances: 1
39
+
40
+ resources:
41
+ cpu: 1
42
+ memory_gb: 0.5
43
+ disk_size_gb: 10
chainlit.md ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Welcome to PandasAI Chainlit: App! πŸš€πŸ€–
2
+
3
+ Hi there, Developers! πŸ‘‹ We're excited to have you on board. This template project is a powerful tool designed to help you prototype, debug and share applications built on top of LLMs with Docker Deployment.
4
+
5
+ ## Useful Links πŸ”—
6
+
7
+ - **Chain Link Documentation:** Get started with our comprehensive [Chainlit Documentation](https://docs.chainlit.io) πŸ“š
8
+ - **PandasAI Documentation:** Get started with PandasAI Documentation [PandasAI Documentation](https://pandas-ai.readthedocs.io/en/latest/) πŸ“š
9
+
10
+ ## FAQ
11
+ ### How to use App Template?
12
+ This is a basic template to set up PandasAI Demo App with Docker and Chainlit
13
+
14
+ ### What Libraries are being use?
15
+ Basic Setup is using Pandasai, Chainlit and openai.
16
+
17
+ ### How to test the APP?
18
+ Provide the OpenAI API keys and run the App
19
+
20
+ ### Disclaimer?
21
+ This is a template App, when using with openai_api key, you will be charged a nominal fee depending
22
+ on number of prompts etc.
23
+
24
+ We can't wait to see what you create with Chainlit! Happy coding! πŸ’»πŸ˜Š
cloudbuild.yaml ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ steps:
2
+ - name: 'gcr.io/cloud-builders/docker'
3
+ id: Build Image
4
+ entrypoint: bash
5
+ args:
6
+ - -c
7
+ - |
8
+ DOCKER_BUILDKIT=1 docker build --target=runtime . -t australia-southeast1-docker.pkg.dev/langchain-chat/app/langchain-chat-app:latest \
9
+ && docker push australia-southeast1-docker.pkg.dev/langchain-chat/app/langchain-chat-app:latest
10
+
11
+ - name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
12
+ entrypoint: gcloud
13
+ id: Deploy API
14
+ args: ['run', 'deploy', 'langchain-chat',
15
+ '--image=australia-southeast1-docker.pkg.dev/langchain-chat/app/langchain-chat-app:latest',
16
+ '--region=australia-southeast1', '--service-account=langchain-app-cr@langchain-chat.iam.gserviceaccount.com',
17
+ '--allow-unauthenticated',
18
+ '--set-env-vars=STREAMLIT_SERVER_PORT=8080']
19
+ waitFor: [ 'Build Image' ]
20
+
21
+ images:
22
+ - australia-southeast1-docker.pkg.dev/langchain-chat/app/langchain-chat-app:latest
docker-compose.yml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ version: '3'
2
+ services:
3
+ langchain-chainlit-chat-app:
4
+ image: pandasai-chainlit-chat-app:latest
5
+ build: ./app
6
+ command: chainlit run demo_app/main.py
7
+ volumes:
8
+ - ./demo_app/:/app/demo_app
9
+ ports:
10
+ - 8000:8000
poetry.lock ADDED
The diff for this file is too large to render. See raw diff
 
poetry.toml ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ [virtualenvs]
2
+ in-project = true
3
+ path = "."
pyproject.toml ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [tool.poetry]
2
+ name = "pandasai-chainlit-docker-template"
3
+ version = "0.1.0"
4
+ description = "A template PandasAI Chainlit App with Docker Deployments"
5
+ authors = ["Amjad Raza"]
6
+ license = "MIT"
7
+ readme = "README.md"
8
+ packages = [{include = "pandasai_chainlit_docker_deployment_template"}]
9
+
10
+
11
+ [tool.poetry.dependencies]
12
+ python = "^3.10"
13
+ openai = "^0.27.8"
14
+ chainlit = "^0.3.0"
15
+ pandasai = "^0.5.2"
16
+
17
+
18
+ [build-system]
19
+ requires = ["poetry-core"]
20
+ build-backend = "poetry.core.masonry.api"
requirements.txt ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ langchain == 0.0.184
2
+ openai == 0.27.7
3
+ streamlit == 1.22.0
4
+ streamlit-chat == 0.0.2.2
ui.PNG ADDED