Skip to content

Commit 6e66b83

Browse files
authored
Merge branch 'google:main' into main
2 parents f35f116 + b55a8d4 commit 6e66b83

29 files changed

+4069
-394
lines changed

.github/workflows/notebooks.yml

Lines changed: 71 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ on:
66
# Relevant PRs
77
pull_request:
88
paths:
9-
- "site/en/**"
9+
- "**.ipynb"
1010
# Allow manual runs
1111
workflow_dispatch:
1212

1313
jobs:
14+
# Format all notebooks.
1415
nbfmt:
1516
name: Notebook format
1617
runs-on: ubuntu-latest
@@ -28,7 +29,7 @@ jobs:
2829
readarray -t changed_notebooks < <(git diff --name-only main | grep '\.ipynb$' || true)
2930
else
3031
# Manual run, check everything
31-
readarray -t changed_notebooks < <(find site/en/ -name '*.ipynb')
32+
readarray -t changed_notebooks < <(find -name '*.ipynb')
3233
fi
3334
if [[ ${#changed_notebooks[@]} == 0 ]]; then
3435
echo "No notebooks modified in this pull request."
@@ -44,21 +45,35 @@ jobs:
4445
steps:
4546
- uses: actions/checkout@v3
4647
- uses: actions/setup-python@v4
48+
- uses: dorny/paths-filter@v2
49+
id: filter
50+
with:
51+
filters: |
52+
website:
53+
- 'site/en/**/**.ipynb'
54+
github_docs:
55+
- 'examples/**/**.ipynb'
56+
- 'demos/**/**.ipynb'
57+
templates:
58+
- 'templates/**/**.ipynb'
4759
- name: Install tensorflow-docs
4860
run: python3 -m pip install -U git+https://github.com/tensorflow/docs
4961
- name: Fetch main branch
5062
run: git fetch -u origin main:main
51-
- name: Lint notebooks
63+
64+
# Full lint for website notebooks (incl. website button)
65+
- name: Lint website notebooks
66+
if: steps.filter.outputs.website == 'true'
5267
run: |
5368
if [ "${{ github.event_name }}" == "pull_request" ]; then
5469
# Only check notebooks modified in this pull request
55-
readarray -t changed_notebooks < <(git diff --name-only main | grep '\.ipynb$' || true)
70+
readarray -t changed_notebooks < <(git diff --name-only main site/en/ |grep '\.ipynb$' || true)
5671
else
5772
# Manual run, check everything
5873
readarray -t changed_notebooks < <(find site/en/ -name '*.ipynb')
5974
fi
6075
if [[ ${#changed_notebooks[@]} == 0 ]]; then
61-
echo "No notebooks modified in this pull request."
76+
echo "No website notebooks modified in this pull request."
6277
exit 0
6378
else
6479
echo "Lint check with nblint:"
@@ -69,3 +84,54 @@ jobs:
6984
--exclude_lint=tensorflow::button_download \
7085
"${changed_notebooks[@]}"
7186
fi
87+
88+
# Reduced lint for notebooks hosted in GitHub
89+
- name: Lint documentation notebooks
90+
if: steps.filter.outputs.github_docs == 'true'
91+
run: |
92+
if [ "${{ github.event_name }}" == "pull_request" ]; then
93+
# Only check notebooks modified in this pull request
94+
readarray -t changed_notebooks < <(git diff --name-only main demos/ examples/ |grep '\.ipynb$' || true)
95+
else
96+
# Manual run, check everything
97+
readarray -t changed_notebooks < <(find demos/ examples/ -name '*.ipynb')
98+
fi
99+
if [[ ${#changed_notebooks[@]} == 0 ]]; then
100+
echo "No GitHub doc notebooks modified in this pull request."
101+
exit 0
102+
else
103+
echo "Lint check with nblint:"
104+
python3 -m tensorflow_docs.tools.nblint \
105+
--styles=google,tensorflow \
106+
--arg=repo:google/generative-ai-docs --arg=branch:main \
107+
--exclude_lint=tensorflow::button_download \
108+
--exclude_lint=tensorflow::button_website \
109+
"${changed_notebooks[@]}"
110+
fi
111+
112+
# Basic lint for template notebooks
113+
- name: Lint template notebooks
114+
if: steps.filter.outputs.templates == 'true'
115+
run: |
116+
if [ "${{ github.event_name }}" == "pull_request" ]; then
117+
# Only check notebooks modified in this pull request
118+
readarray -t changed_notebooks < <(git diff --name-only main templates/ |grep '\.ipynb$' || true)
119+
else
120+
# Manual run, check everything
121+
readarray -t changed_notebooks < <(find templates/ -name '*.ipynb')
122+
fi
123+
if [[ ${#changed_notebooks[@]} == 0 ]]; then
124+
echo "No template notebooks modified in this pull request."
125+
exit 0
126+
else
127+
echo "Lint check with nblint:"
128+
python3 -m tensorflow_docs.tools.nblint \
129+
--styles=google,tensorflow \
130+
--arg=repo:google/generative-ai-docs --arg=branch:main \
131+
--exclude_lint=tensorflow::button_download \
132+
--exclude_lint=tensorflow::button_website \
133+
--exclude_lint=tensorflow::button_colab \
134+
--exclude_lint=tensorflow::button_github \
135+
"${changed_notebooks[@]}"
136+
fi
137+

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
**/proofreading
88
**/venv
99
**/.python-version
10+
**/node_modules

CODEOWNERS

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
* @google/generative-ai-admin
22

3-
demos/palm/web/talking-character @lyleaf @jayjicheng @blownhither
4-
demos/palm/web/mood-food @lyleaf @jayjicheng
5-
demos/palm/web/travel-planner @lyleaf @jayjicheng
6-
demos/palm/web/list-it @mrayinteractive @aaron-wade
7-
demos/palm/web/quick-prompt @mrayinteractive @aaron-wade
8-
demos/palm/web/textfx @mrayinteractive @aaron-wade
3+
# demos/palm/web/talking-character
4+
# demos/palm/web/mood-food
5+
# demos/palm/web/travel-planner
6+
# demos/palm/web/list-it
7+
# demos/palm/web/quick-prompt
8+
# demos/palm/web/textfx
99
demos/palm/python/docs-agent @nickvander @rundong08 @Meggin @kyolee415
1010
demos/palm/node/pipet-code-agent @joefernandez @shilpakancharla @markmcd
1111

DEMO_MAINTAINERS.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Demo Maintenance
2+
3+
We have several [demo applications](https://github.com/google/generative-ai-docs/tree/main/demos/palm) hosted in this repository that are referenced in the [AI for Developers](https://ai.google.dev/develop/sample-apps) site. We're looking to the community to help maintain them.
4+
Thank you in advance for your contributions!
5+
6+
## Responsibilities
7+
8+
While we would love to accept any meaningful contributions to the demos, some tasks we'd particularly like help with include:
9+
1. Create a process to verify that the app works as desired after any changes are made (preferably automated, but a manual testing process works well to start)
10+
2. Get dependencies up-to-date
11+
3. Review and fix any outstanding issues and PRs (you can filter by the `demos:XYZ` [label](https://github.com/google/generative-ai-docs/labels?q=demos%3A))
12+
4. Migrate from PaLM to Gemini
13+
14+
## Next Steps
15+
16+
If you're interested and commited to maintaining one of the demos, please complete the following:
17+
- Read through the [Contributing Guide](https://github.com/google/generative-ai-docs/blob/main/CONTRIBUTING.md)
18+
- Submit a PR to add your GitHub handle next to the demo you're interested in maintaining, in the section below
19+
20+
## Active Maintainers
21+
22+
| Demo | Maintainers |
23+
| ------------- | ------------- |
24+
| [list-it](https://github.com/google/generative-ai-docs/tree/main/demos/palm/web/list-it) | |
25+
| [mood-food](https://github.com/google/generative-ai-docs/tree/main/demos/palm/web/mood-food) | |
26+
| [quick-prompt](https://github.com/google/generative-ai-docs/tree/main/demos/palm/web/quick-prompt) | |
27+
| [talking-character](https://github.com/google/generative-ai-docs/tree/main/demos/palm/web/talking-character) | |
28+
| [textfx](https://github.com/google/generative-ai-docs/tree/main/demos/palm/web/textfx) | |
29+
| [travel-planner](https://github.com/google/generative-ai-docs/tree/main/demos/palm/web/travel-planner) | @ghat0tkach |
30+
| [docs-agent](https://github.com/google/generative-ai-docs/tree/main/demos/palm/python/docs-agent) | @nickvander @rundong08 @Meggin @kyolee415 |
31+
| [pipet-code-agent](https://github.com/google/generative-ai-docs/tree/main/demos/palm/node/pipet-code-agent) | @joefernandez @shilpakancharla @markmcd |

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ the [Generative AI developer site](https://developers.generativeai.google/).
66
To contribute to the site documentation, please read
77
[CONTRIBUTING.md](CONTRIBUTING.md).
88

9+
To contribute as a demo app maintainer, please read
10+
[DEMO_MAINTAINERS.md](DEMO_MAINTAINERS.md).
11+
912
To file an issue, please use the
1013
[GitHub issue tracker](https://github.com/google/generative-ai-docs/issues/new).
1114

0 commit comments

Comments
 (0)