-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add conversational genai app template
- Loading branch information
1 parent
710920c
commit 33ccedc
Showing
80 changed files
with
13,612 additions
and
1 deletion.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
.github/workflows/_e2e_gen_ai_app_starter_kit__lint_and_test.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Conversational Gen AI template - Lint and Test | ||
|
||
on: | ||
push: | ||
paths: | ||
- "gemini/sample-apps/e2e-gen-ai-app-starter-kit/**" | ||
pull_request: | ||
paths: | ||
- "gemini/sample-apps/e2e-gen-ai-app-starter-kit/**" | ||
|
||
jobs: | ||
lint-and-test: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: gemini/sample-apps/e2e-gen-ai-app-starter-kit | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
- name: Install Poetry and dependencies | ||
run: | | ||
pip install poetry==1.8.3 --user | ||
python -m poetry install --with lint,streamlit | ||
- name: Lint python code | ||
run: | | ||
poetry run codespell | ||
poetry run ruff . | ||
poetry run mypy . | ||
poetry run black . --check | ||
- name: Run tests | ||
run: | | ||
poetry run pytest tests/unit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
194 changes: 194 additions & 0 deletions
194
gemini/sample-apps/e2e-gen-ai-app-starter-kit/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,194 @@ | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*.pyc | ||
*$py.class | ||
**/dist | ||
/tmp | ||
/out-tsc | ||
/bazel-out | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
pip-wheel-metadata/ | ||
share/python-wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
MANIFEST | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.nox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
*.py,cover | ||
.hypothesis/ | ||
.pytest_cache/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
local_settings.py | ||
db.sqlite3 | ||
db.sqlite3-journal | ||
|
||
# Flask stuff: | ||
instance/ | ||
.webassets-cache | ||
|
||
# Scrapy stuff: | ||
.scrapy | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
||
# Jupyter Notebook | ||
.ipynb_checkpoints | ||
|
||
# IPython | ||
profile_default/ | ||
ipython_config.py | ||
|
||
# pyenv | ||
.python-version | ||
|
||
# pipenv | ||
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. | ||
# However, in case of collaboration, if having platform-specific dependencies or dependencies | ||
# having no cross-platform support, pipenv may install dependencies that don't work, or not | ||
# install all needed dependencies. | ||
Pipfile.lock | ||
Pipfile | ||
|
||
# PEP 582; used by e.g. github.com/David-OConnor/pyflow | ||
__pypackages__/ | ||
|
||
# Celery stuff | ||
celerybeat-schedule | ||
celerybeat.pid | ||
|
||
# SageMath parsed files | ||
*.sage.py | ||
|
||
# Environments | ||
.env | ||
.venv | ||
.venv* | ||
env/ | ||
venv/ | ||
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
.spyproject | ||
|
||
# Rope project settings | ||
.ropeproject | ||
|
||
# mkdocs documentation | ||
/site | ||
|
||
# mypy | ||
.mypy_cache/ | ||
.dmypy.json | ||
dmypy.json | ||
|
||
# Pyre type checker | ||
.pyre/ | ||
|
||
# macOS | ||
.DS_Store | ||
|
||
# PyCharm | ||
.idea | ||
|
||
# User-specific files | ||
.terraform* | ||
.Terraform* | ||
|
||
|
||
tmp* | ||
|
||
# Node | ||
**/node_modules | ||
npm-debug.log | ||
yarn-error.log | ||
|
||
# IDEs and editors | ||
.idea/ | ||
.project | ||
.classpath | ||
.c9/ | ||
*.launch | ||
.settings/ | ||
*.sublime-workspace | ||
|
||
# Visual Studio Code | ||
.vscode/* | ||
!.vscode/settings.json | ||
!.vscode/tasks.json | ||
!.vscode/launch.json | ||
!.vscode/extensions.json | ||
.history/* | ||
|
||
# Miscellaneous | ||
**/.angular/* | ||
/.angular/cache | ||
.sass-cache/ | ||
/connect.lock | ||
/coverage | ||
/libpeerconnection.log | ||
testem.log | ||
/typings | ||
|
||
# System files | ||
.DS_Store | ||
Thumbs.db | ||
*.vscode* | ||
|
||
.persist_vector_store | ||
tests/load_test/.results/*.html | ||
tests/load_test/.results/*.csv | ||
locust_env | ||
my_env.tfvars | ||
.streamlit_chats | ||
.saved_chats |
47 changes: 47 additions & 0 deletions
47
gemini/sample-apps/e2e-gen-ai-app-starter-kit/CONTRIBUTING.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# How to Contribute | ||
|
||
We'd love to accept your patches and contributions to this sample. There are | ||
just a few small guidelines you need to follow. | ||
|
||
## Contributor License Agreement | ||
|
||
Contributions to this project must be accompanied by a Contributor License Agreement. You (or your employer) retain the copyright to your contribution; this simply gives us permission to use and redistribute your contributions as part of the project. Head over to [Google Developers CLA](https://cla.developers.google.com/) to see your current agreements on file or to sign a new one. | ||
|
||
You generally only need to submit a CLA once, so if you've already submitted one (even if it was for a different project), you probably don't need to do it again. | ||
|
||
## Community Guidelines, Code Reviews, Contributor Guide | ||
|
||
Please refer to the [root repository CONTRIBUTING.md file](https://github.com/GoogleCloudPlatform/generative-ai/blob/main/CONTRIBUTING.md) for Community Guidelines, Code Reviews, Contributor Guide, or specific guidance for Google Employees. | ||
|
||
## Code Quality Checks | ||
|
||
To ensure code quality, we utilize automated checks. Before submitting a pull request, please run the following commands locally: | ||
|
||
```bash | ||
poetry install --with streamlit,jupyter,lint | ||
``` | ||
|
||
This installs development dependencies, including linting tools. | ||
|
||
Then, execute the following Makefile targets: | ||
|
||
```bash | ||
make lint | ||
``` | ||
|
||
This command runs the following linters to check for code style, potential errors, and type hints: | ||
|
||
- **codespell**: Detects common spelling mistakes in code and documentation. | ||
- **ruff**: A fast linter that combines the functionality of several popular tools like flake8, isort, pycodestyle, and others. | ||
- **mypy**: Performs static type checking to catch type errors before runtime. | ||
|
||
```bash | ||
make test | ||
``` | ||
|
||
This command runs the test suite using pytest, covering both unit and integration tests: | ||
|
||
- **`poetry run pytest tests/unit`**: Executes unit tests located in the `tests/unit` directory. | ||
- **`poetry run pytest tests/integration`**: Executes integration tests located in the `tests/integration` directory. | ||
|
||
Your pull request will also be automatically checked by these tools using GitHub Actions. Ensuring your code passes these checks locally will help expedite the review process. |
Oops, something went wrong.