Skip to content

Commit f16339b

Browse files
authored
Merge branch 'google:main' into main
2 parents c8529d0 + f640390 commit f16339b

16 files changed

+506
-225
lines changed

CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ examples/gemini/python/docs-agent @nickvander @rundong08 @Meggin @kyolee415
1010
examples/gemini/node/flutter_theme_agent/ @khanhnwin @joefernandez
1111
demos/palm/node/pipet-code-agent @joefernandez @shilpakancharla @markmcd
1212

13+
templates/ @google/ai-studio-team
1314
site/ @google/generative-ai-site-team

site/en/tutorials/function_calling_python_quickstart.ipynb renamed to site/en/gemini-api/docs/function-calling/python.ipynb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@
4848
"source": [
4949
"<table class=\"tfo-notebook-buttons\" align=\"left\">\n",
5050
" <td>\n",
51-
" <a target=\"_blank\" href=\"https://ai.google.dev/tutorials/function_calling_python_quickstart\"><img src=\"https://ai.google.dev/static/site-assets/images/docs/notebook-site-button.png\" height=\"32\" width=\"32\" />View on ai.google.dev</a>\n",
51+
" <a target=\"_blank\" href=\"https://ai.google.dev/gemini-api/docs/function-calling/python\"><img src=\"https://ai.google.dev/static/site-assets/images/docs/notebook-site-button.png\" height=\"32\" width=\"32\" />View on ai.google.dev</a>\n",
5252
" </td>\n",
5353
" <td>\n",
54-
" <a target=\"_blank\" href=\"https://colab.research.google.com/github/google/generative-ai-docs/blob/main/site/en/tutorials/function_calling_python_quickstart.ipynb\"><img src=\"https://www.tensorflow.org/images/colab_logo_32px.png\" />Run in Google Colab</a>\n",
54+
" <a target=\"_blank\" href=\"https://colab.research.google.com/github/google/generative-ai-docs/blob/main/site/en/gemini-api/docs/function-calling/python.ipynb\"><img src=\"https://www.tensorflow.org/images/colab_logo_32px.png\" />Run in Google Colab</a>\n",
5555
" </td>\n",
5656
" <td>\n",
57-
" <a target=\"_blank\" href=\"https://github.com/google/generative-ai-docs/blob/main/site/en/tutorials/function_calling_python_quickstart.ipynb\"><img src=\"https://www.tensorflow.org/images/GitHub-Mark-32px.png\" />View source on GitHub</a>\n",
57+
" <a target=\"_blank\" href=\"https://github.com/google/generative-ai-docs/blob/main/site/en/gemini-api/docs/function-calling/python.ipynb\"><img src=\"https://www.tensorflow.org/images/GitHub-Mark-32px.png\" />View source on GitHub</a>\n",
5858
" </td>\n",
5959
"</table>"
6060
]
@@ -185,13 +185,13 @@
185185
"try:\n",
186186
" # Used to securely store your API key\n",
187187
" from google.colab import userdata\n",
188-
" \n",
188+
"\n",
189189
" # Or use `os.getenv('API_KEY')` to fetch an environment variable.\n",
190190
" GOOGLE_API_KEY=userdata.get('GOOGLE_API_KEY')\n",
191191
"except ImportError:\n",
192192
" import os\n",
193193
" GOOGLE_API_KEY = os.environ['GOOGLE_API_KEY']\n",
194-
" \n",
194+
"\n",
195195
"genai.configure(api_key=GOOGLE_API_KEY)"
196196
]
197197
},
@@ -761,7 +761,7 @@
761761
],
762762
"metadata": {
763763
"colab": {
764-
"name": "function_calling_python_quickstart.ipynb",
764+
"name": "python.ipynb",
765765
"toc_visible": true
766766
},
767767
"google": {

site/en/tutorials/python_quickstart.ipynb renamed to site/en/gemini-api/docs/get-started/python.ipynb

Lines changed: 8 additions & 8 deletions
Large diffs are not rendered by default.

site/en/tutorials/rest_quickstart.ipynb renamed to site/en/gemini-api/docs/get-started/rest.ipynb

Lines changed: 8 additions & 8 deletions
Large diffs are not rendered by default.

site/en/tutorials/tuning_quickstart_python.ipynb renamed to site/en/gemini-api/docs/model-tuning/python.ipynb

Lines changed: 10 additions & 15 deletions
Large diffs are not rendered by default.

site/en/tutorials/tuning_quickstart_rest.ipynb renamed to site/en/gemini-api/docs/model-tuning/rest.ipynb

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"id": "yeadDkMiISin"
3838
},
3939
"source": [
40-
"# REST API: Tuning Quickstart"
40+
"# REST API: Model tuning"
4141
]
4242
},
4343
{
@@ -48,16 +48,13 @@
4848
"source": [
4949
"<table class=\"tfo-notebook-buttons\" align=\"left\">\n",
5050
" <td>\n",
51-
" <a target=\"_blank\" href=\"https://ai.google.dev/tutorials/tuning_quickstart_rest\"><img src=\"https://ai.google.dev/static/site-assets/images/docs/notebook-site-button.png\" height=\"32\" width=\"32\" />View on ai.google.dev</a>\n",
51+
" <a target=\"_blank\" href=\"https://ai.google.dev/gemini-api/docs/model-tuning/rest\"><img src=\"https://ai.google.dev/static/site-assets/images/docs/notebook-site-button.png\" height=\"32\" width=\"32\" />View on ai.google.dev</a>\n",
5252
" </td>\n",
5353
" <td>\n",
54-
" <a target=\"_blank\" href=\"https://colab.research.google.com/github/google/generative-ai-docs/blob/main/site/en/tutorials/tuning_quickstart_rest.ipynb\"><img src=\"https://www.tensorflow.org/images/colab_logo_32px.png\" />Run in Google Colab</a>\n",
54+
" <a target=\"_blank\" href=\"https://colab.research.google.com/github/google/generative-ai-docs/blob/main/site/en/gemini-api/docs/model-tuning/rest.ipynb\"><img src=\"https://www.tensorflow.org/images/colab_logo_32px.png\" />Run in Google Colab</a>\n",
5555
" </td>\n",
5656
" <td>\n",
57-
" <a target=\"_blank\" href=\"https://github.com/google/generative-ai-docs/blob/main/site/en/tutorials/tuning_quickstart_rest.ipynb\"><img src=\"https://www.tensorflow.org/images/GitHub-Mark-32px.png\" />View source on GitHub</a>\n",
58-
" </td>\n",
59-
" <td>\n",
60-
" <a target=\"_blank\" href=\"https://ai.google.dev/tutorials/tuning_quickstart_rest\"><img src=\"https://www.tensorflow.org/images/download_logo_32px.png\" />Download notebook</a>\n",
57+
" <a target=\"_blank\" href=\"https://github.com/google/generative-ai-docs/blob/main/site/en/gemini-api/docs/model-tuning/rest.ipynb\"><img src=\"https://www.tensorflow.org/images/GitHub-Mark-32px.png\" />View source on GitHub</a>\n",
6158
" </td>\n",
6259
"</table>"
6360
]
@@ -108,7 +105,7 @@
108105
"your tuned models this needs stricter access controls than API-Keys can provide.\n",
109106
"\n",
110107
"Before you can run this tutorial, you'll need to\n",
111-
"[setup OAuth for your project](oauth_quickstart.ipynb).\n",
108+
"[setup OAuth for your project](https://ai.google.dev/gemini-api/docs/oauth).\n",
112109
"\n",
113110
"\n",
114111
"In Colab the easiest wat to get setup is to copy the contents of your `client_secret.json` file into Colab's \"Secrets manager\" (under the key icon in the left panel) with the secret name `CLIENT_SECRET`."
@@ -556,7 +553,7 @@
556553
"source": [
557554
"The output from your model may or may not be correct. If the tuned model isn't performing up to your required standards, you can try adding more high quality examples, tweaking the hyperparameters or adding a preamble to your examples. You can even create another tuned model based on the first one you created.\n",
558555
"\n",
559-
"See the [tuning guide](../guide/model_tuning_guidance) for more guidance on improving performance."
556+
"See the [tuning guide](https://ai.google.dev/gemini-api/docs/model-tuning) for more guidance on improving performance."
560557
]
561558
},
562559
{
@@ -1037,7 +1034,7 @@
10371034
],
10381035
"metadata": {
10391036
"colab": {
1040-
"name": "tuning_quickstart_rest.ipynb",
1037+
"name": "rest.ipynb",
10411038
"toc_visible": true
10421039
},
10431040
"kernelspec": {

site/en/tutorials/prompting_with_media.ipynb renamed to site/en/gemini-api/docs/prompting_with_media.ipynb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,15 @@
218218
"metadata": {
219219
"id": "N9NxXGZKKusG"
220220
},
221-
"outputs": [],
221+
"outputs": [
222+
{
223+
"name": "stdout",
224+
"output_type": "stream",
225+
"text": [
226+
"Uploaded file 'Sample drawing' as: https://generativelanguage.googleapis.com/v1beta/files/ui00j5zfuqe0\n"
227+
]
228+
}
229+
],
222230
"source": [
223231
"sample_file = genai.upload_file(path=\"image.jpg\",\n",
224232
" display_name=\"Sample drawing\")\n",

site/en/docs/semantic_retriever.ipynb renamed to site/en/gemini-api/docs/semantic_retrieval.ipynb

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"id": "1_3oPpdBAduw"
3838
},
3939
"source": [
40-
"# Semantic Retriever Quickstart"
40+
"# Get started with semantic retrieval"
4141
]
4242
},
4343
{
@@ -48,12 +48,12 @@
4848
"source": [
4949
"<table class=\"tfo-notebook-buttons\" align=\"left\">\n",
5050
" <td>\n",
51-
" <a target=\"_blank\" href=\"https://ai.google.dev/docs/semantic_retriever\"><img src=\"https://ai.google.dev/static/site-assets/images/docs/notebook-site-button.png\" height=\"32\" width=\"32\" />View on ai.google.dev</a>\n",
51+
" <a target=\"_blank\" href=\"https://ai.google.dev/gemini-api/docs/semantic_retrieval\"><img src=\"https://ai.google.dev/static/site-assets/images/docs/notebook-site-button.png\" height=\"32\" width=\"32\" />View on ai.google.dev</a>\n",
5252
" <td>\n",
53-
" <a target=\"_blank\" href=\"https://colab.research.google.com/github/google/generative-ai-docs/blob/main/site/en/docs/semantic_retriever.ipynb\"><img src=\"https://www.tensorflow.org/images/colab_logo_32px.png\" />Run in Google Colab</a>\n",
53+
" <a target=\"_blank\" href=\"https://colab.research.google.com/github/google/generative-ai-docs/blob/main/site/en/gemini-api/docs/semantic_retrieval.ipynb\"><img src=\"https://www.tensorflow.org/images/colab_logo_32px.png\" />Run in Google Colab</a>\n",
5454
" </td>\n",
5555
" <td>\n",
56-
" <a target=\"_blank\" href=\"https://github.com/google/generative-ai-docs/blob/main/site/en/docs/semantic_retriever.ipynb\"><img src=\"https://www.tensorflow.org/images/GitHub-Mark-32px.png\" />View source on GitHub</a>\n",
56+
" <a target=\"_blank\" href=\"https://github.com/google/generative-ai-docs/blob/main/site/en/gemini-api/docs/semantic_retrieval.ipynb\"><img src=\"https://www.tensorflow.org/images/GitHub-Mark-32px.png\" />View source on GitHub</a>\n",
5757
" </td>\n",
5858
"</table>"
5959
]
@@ -113,7 +113,7 @@
113113
"source": [
114114
"## Authenticate\n",
115115
"\n",
116-
"The Semantic Retriever API lets you perform semantic search on your own data. Since it's **your data**, this needs stricter access controls than API keys. Authenticate with OAuth with [service accounts](#scrollTo=eLjhFIOQ7_Dk) or through your [user credentials](#scrollTo=9YGv4x9ehLba).\n",
116+
"The Semantic Retriever API lets you perform semantic search on your own data. Since it's **your data**, this needs stricter access controls than API keys. Authenticate with OAuth with [service accounts](#service-oauth) or through your [user credentials](#user-oauth).\n",
117117
"\n",
118118
"This quickstart uses a simplified authentication approach meant for a testing environment, and service account setups are typically easier to start from. For a production environment, learn about [authentication and authorization](https://developers.google.com/workspace/guides/auth-overview){:.external} before choosing the [access credentials](https://developers.google.com/workspace/guides/create-credentials#choose_the_access_credential_that_is_right_for_you){:.external} that are appropriate for your app.\n"
119119
]
@@ -124,7 +124,7 @@
124124
"id": "eLjhFIOQ7_Dk"
125125
},
126126
"source": [
127-
"### Setup OAuth using service accounts\n",
127+
"### Setup OAuth using service accounts {:#service-oauth}\n",
128128
"\n",
129129
"Follow the steps below to setup OAuth using service accounts:\n",
130130
"\n",
@@ -204,7 +204,7 @@
204204
"id": "4EQJD2PWD56T"
205205
},
206206
"source": [
207-
"## Create a corpus\n",
207+
"## Create a corpus {:#create-corpus}\n",
208208
"\n",
209209
"The Semantic Retriever API lets you define up to 5 custom text corpora per project. You can specify either of the following fields while defining your corpora:\n",
210210
"\n",
@@ -218,7 +218,25 @@
218218
"metadata": {
219219
"id": "AaPZiXVwEDHZ"
220220
},
221-
"outputs": [],
221+
"outputs": [
222+
{
223+
"name": "stdout",
224+
"output_type": "stream",
225+
"text": [
226+
"name: \"corpora/google-for-developers-blog-dqrtz8rs0jg\"\n",
227+
"display_name: \"Google for Developers Blog\"\n",
228+
"create_time {\n",
229+
" seconds: 1713497533\n",
230+
" nanos: 587977000\n",
231+
"}\n",
232+
"update_time {\n",
233+
" seconds: 1713497533\n",
234+
" nanos: 587977000\n",
235+
"}\n",
236+
"\n"
237+
]
238+
}
239+
],
222240
"source": [
223241
"example_corpus = glm.Corpus(display_name=\"Google for Developers Blog\")\n",
224242
"create_corpus_request = glm.CreateCorpusRequest(corpus=example_corpus)\n",
@@ -739,7 +757,7 @@
739757
"Since a low `answerable_probability` indicates that the GenerateAnswerResponse.answer is likely wrong or ungrounded, **it is highly recommended to further process the response by inspecting `answerable_probability`**.\n",
740758
"\n",
741759
"When `answerable_probability` is low, some clients may wish to:\n",
742-
"* Display a message to the effect of \"We couldn't answer that question\" to the end user.\n",
760+
"* Display a message to the effect of \"couldn't answer that question\" to the end user.\n",
743761
"* Fall back to a general-purpose LLM that answers the question from world knowledge. The threshold and nature of such fallbacks will depend on individual use cases. A value of `answerable_probability` <= 0.5 is a good starting threshold.\n"
744762
]
745763
},
@@ -934,7 +952,7 @@
934952
"id": "9YGv4x9ehLba"
935953
},
936954
"source": [
937-
"## Appendix: Setup OAuth with user credentials\n",
955+
"## Appendix: Setup OAuth with user credentials {:#user-oauth}\n",
938956
"\n",
939957
"Follow the steps below from the [OAuth Quickstart](https://ai.google.dev/docs/oauth_quickstart) to setup OAuth authentication.\n",
940958
"\n",
@@ -977,7 +995,7 @@
977995
"id": "lybTOlN9gz0I"
978996
},
979997
"source": [
980-
"Initialize the client library and re-run the notebook starting from [Create a corpus](#scrollTo=4EQJD2PWD56T)."
998+
"Initialize the client library and re-run the notebook starting from [Create a corpus](#create-corpus)."
981999
]
9821000
},
9831001
{
@@ -998,7 +1016,7 @@
9981016
],
9991017
"metadata": {
10001018
"colab": {
1001-
"name": "semantic_retriever.ipynb",
1019+
"name": "semantic_retrieval.ipynb",
10021020
"toc_visible": true
10031021
},
10041022
"google": {

site/en/examples/anomaly_detection.ipynb renamed to site/en/gemini-api/tutorials/anomaly_detection.ipynb

Lines changed: 7 additions & 7 deletions
Large diffs are not rendered by default.

site/en/examples/clustering_with_embeddings.ipynb renamed to site/en/gemini-api/tutorials/clustering_with_embeddings.ipynb

Lines changed: 6 additions & 6 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)