Skip to content

Commit

Permalink
Replace path -> files (#428)
Browse files Browse the repository at this point in the history
* Replace path -> files

* pin version

---------

Co-authored-by: Mark McDonald <[email protected]>
  • Loading branch information
MarkDaoust and markmcd authored Jan 31, 2025
1 parent 9ae354e commit 09f3b17
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions quickstarts/Get_started.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
}
],
"source": [
"!pip install -U -q google-genai"
"!pip install -U -q 'google-genai==0.8.0'"
]
},
{
Expand Down Expand Up @@ -1104,7 +1104,7 @@
],
"source": [
"# Upload the file using the API\n",
"file_upload = client.files.upload(path=img_path)\n",
"file_upload = client.files.upload(file=img_path)\n",
"\n",
"response = client.models.generate_content(\n",
" model=MODEL_ID,\n",
Expand Down Expand Up @@ -1487,7 +1487,7 @@
],
"source": [
"# Upload the file using the API\n",
"file_upload = client.files.upload(path=text_path)\n",
"file_upload = client.files.upload(file=text_path)\n",
"\n",
"response = client.models.generate_content(\n",
" model=MODEL_ID,\n",
Expand Down Expand Up @@ -1588,7 +1588,7 @@
],
"source": [
"# Upload the file using the API\n",
"file_upload = client.files.upload(path=pdf_path)\n",
"file_upload = client.files.upload(file=pdf_path)\n",
"\n",
"response = client.models.generate_content(\n",
" model=MODEL_ID,\n",
Expand Down Expand Up @@ -1678,7 +1678,7 @@
],
"source": [
"# Upload the file using the API\n",
"file_upload = client.files.upload(path=audio_path)\n",
"file_upload = client.files.upload(file=audio_path)\n",
"\n",
"response = client.models.generate_content(\n",
" model=MODEL_ID,\n",
Expand Down Expand Up @@ -1765,7 +1765,7 @@
}
],
"source": [
"video_file = client.files.upload(path=video_file_name)\n",
"video_file = client.files.upload(file=video_file_name)\n",
"print(f\"Completed upload: {video_file.uri}\")"
]
},
Expand Down Expand Up @@ -1964,7 +1964,7 @@
" file_bytes = requests.get(url).content\n",
" name = pathlib.Path(url).name\n",
" pathlib.Path(name).write_bytes(file_bytes)\n",
" uploads.append(client.files.upload(path=name, config=dict(mime_type=mime_type)))"
" uploads.append(client.files.upload(file=name, config=dict(mime_type=mime_type)))"
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions quickstarts/Video_understanding.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
}
],
"source": [
"!pip install -U -q google-genai"
"!pip install -U -q 'google-genai==0.8.0'"
]
},
{
Expand Down Expand Up @@ -318,7 +318,7 @@
"import time\n",
"\n",
"def upload_video(video_file_name):\n",
" video_file = client.files.upload(path=video_file_name)\n",
" video_file = client.files.upload(file=video_file_name)\n",
"\n",
" while video_file.state == \"PROCESSING\":\n",
" print('Waiting for video to be processed.')\n",
Expand Down

0 comments on commit 09f3b17

Please sign in to comment.