forked from google-gemini/cookbook
-
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 'google-gemini:main' into main
- Loading branch information
Showing
94 changed files
with
8,702 additions
and
1,255 deletions.
There are no files selected for viewing
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,17 @@ | ||
{ | ||
"name": "Gemini Cookbook Dev Container", | ||
"image": "mcr.microsoft.com/devcontainers/universal:2", | ||
"waitFor": "onCreateCommand", | ||
"updateContentCommand": "python3 -m pip install ipywidgets", | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"ms-toolsai.jupyter", | ||
"ms-python.python", | ||
"eamodio.gitlens" | ||
] | ||
} | ||
}, | ||
|
||
"postCreateCommand": "sudo cp .devcontainer/welcome.txt /usr/local/etc/vscode-dev-containers/first-run-notice.txt" | ||
} |
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,6 @@ | ||
👋 Welcome to the Gemini API Cookbook! This repo is a collection of all the guides and examples for the Gemini API. | ||
- To get started, make sure you have an API Key from [Google AI | ||
studio](https://aistudio.google.com/app/apikey) | ||
- Note that the notebooks were written to run in Google Colab, so they may | ||
not always work in Codespaces | ||
- Check out the 'README.md' file to know more |
55 changes: 55 additions & 0 deletions
55
.github/workflows/new_examples_links_in_table_of_content.yml
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,55 @@ | ||
name: All new examples are linked in the README | ||
|
||
on: | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
new-example-links-in-examples-readme: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
- name: Get Changed Files | ||
id: changed-files | ||
uses: tj-actions/changed-files@v45 | ||
with: | ||
files: | | ||
examples/**/*.ipynb | ||
- name: Check README links | ||
env: | ||
# We only want the added file so that if we do an exception we dop not have to make an exception again each time qu're editing the file | ||
NEW_FILES: ${{ steps.changed-files.outputs.all_changed_files }} | ||
README: examples/README.md | ||
run: | | ||
all_linked=true | ||
for file in ${NEW_FILES}; do | ||
echo "$file was added" | ||
# Get the directory of the new notebook file | ||
notebook_dir=$(dirname "$file") | ||
# Get the filename without the directory path | ||
filename=$(basename "$file") | ||
# Check if link exists in $README | ||
if ! grep -q "$file" "$README" && ! grep -q "${file/examples\//](}" "$README"; then | ||
# Check if a README.md exists in the sub-folder, and if so, check for the link there | ||
if [[ -f "$notebook_dir/README.md" ]]; then | ||
if ! grep -q "$filename" "$notebook_dir/README.md"; then | ||
all_linked=false | ||
echo " Link to '$file' not found in "$README".md or $notebook_dir/README.md" | ||
echo "::warning file=$file::Link to '$file' not found in a README.md, please add one" | ||
else | ||
echo " Link to '$file' found in $notebook_dir/README.md" | ||
fi | ||
else | ||
all_linked=false | ||
echo " Link to '$file' not found in $README, and no README.md found in $notebook_dir" | ||
echo "::warning file=$file::Link to '$file' not found in $README, please add one (or create a README.md in the sub-folder)" | ||
fi | ||
else | ||
echo " Link to '$file' found in $README" | ||
fi | ||
done | ||
if ! $all_linked; then | ||
exit 1 | ||
fi |
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
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
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.