forked from GoogleCloudPlatform/generative-ai
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into abhishekbhagwat-patch
- Loading branch information
Showing
65 changed files
with
13,875 additions
and
7 deletions.
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
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
[MESSAGES CONTROL] | ||
disable=E0401,C0301 | ||
disable=E0401,C0301,R0903,R1710,C0114,R0915,W1514,W1203,I1101 |
29 changes: 29 additions & 0 deletions
29
.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,29 @@ | ||
name: End-to-end Gen AI starter kit - Unit test | ||
|
||
on: | ||
push: | ||
paths: | ||
- "gemini/sample-apps/e2e-gen-ai-app-starter-pack/**" | ||
pull_request: | ||
paths: | ||
- "gemini/sample-apps/e2e-gen-ai-app-starter-pack/**" | ||
|
||
jobs: | ||
unit-test: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: gemini/sample-apps/e2e-gen-ai-app-starter-pack | ||
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 | ||
- 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
194 changes: 194 additions & 0 deletions
194
gemini/sample-apps/e2e-gen-ai-app-starter-pack/.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 |
49 changes: 49 additions & 0 deletions
49
gemini/sample-apps/e2e-gen-ai-app-starter-pack/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,49 @@ | ||
# 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 Make command: | ||
|
||
```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. | ||
- **pylint**: Analyzes code for errors, coding standards, and potential problems. | ||
- **flake8**: Enforces style consistency and checks for logical errors. | ||
- **mypy**: Performs static type checking to catch type errors before runtime. | ||
- **black**: Automatically formats Python code to adhere to the PEP 8 style guide. | ||
|
||
```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.