Skip to content

Commit

Permalink
docs: Regenerate docs for 1.2.0
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 726072218
  • Loading branch information
sararob authored and copybara-github committed Feb 12, 2025
1 parent 08a260d commit 30a3493
Show file tree
Hide file tree
Showing 9 changed files with 376 additions and 301 deletions.
48 changes: 44 additions & 4 deletions docs/_sources/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,37 @@ run all the examples to see how it behaves under different APIs.
vertexai=True, project='your-project-id', location='us-central1'
)
**(Optional) Using environment variables:**

You can create a client by configuring the necessary environmental variables.
Configuration setup instructions depends on whether the user is using the ML Dev
Gemini API or the Vertex AI Gemini API.

**ML Dev API:** Set `GOOGLE_API_KEY` as shown below:

.. code:: bash
export GOOGLE_API_KEY='your-api-key'
**Vertex AI Gemini API:** Set `GOOGLE_GENAI_USE_VERTEXAI`, `GOOGLE_CLOUD_PROJECT`
and `GOOGLE_CLOUD_LOCATION`, as shown below:

.. code:: bash
export GOOGLE_GENAI_USE_VERTEXAI=false
export GOOGLE_CLOUD_PROJECT='your-project-id'
export GOOGLE_CLOUD_LOCATION='us-central1'
```python
client = genai.Client()
```

API Selection
^^^^^^^^^^^^^

To set the API version use ``http_options``. For example, to set the API version to ``v1`` for Vertex AI:

.. code:: python
Expand Down Expand Up @@ -103,7 +134,7 @@ python code.

.. code:: python
file = client.files.upload(path='a11.txt')
file = client.files.upload(file='a11.txt')
response = client.models.generate_content(
model='gemini-2.0-flash-001',
contents=['Could you summarize this file?', file]
Expand Down Expand Up @@ -811,18 +842,27 @@ Upload

.. code:: python
file1 = client.files.upload(path='2312.11805v3.pdf')
file2 = client.files.upload(path='2403.05530.pdf')
file1 = client.files.upload(file='2312.11805v3.pdf')
file2 = client.files.upload(file='2403.05530.pdf')
print(file1)
print(file2)
Get
---

.. code:: python
file1 = client.files.upload(file='2312.11805v3.pdf')
file_info = client.files.get(name=file1.name)
Delete
------

.. code:: python
file3 = client.files.upload(path='2312.11805v3.pdf')
file3 = client.files.upload(file='2312.11805v3.pdf')
client.files.delete(name=file3.name)
Expand Down
460 changes: 230 additions & 230 deletions docs/_static/pygments.css

Large diffs are not rendered by default.

67 changes: 35 additions & 32 deletions docs/genai.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="color-scheme" content="light dark"><link rel="index" title="Index" href="#" /><link rel="search" title="Search" href="search.html" />

<!-- Generated with Sphinx 8.1.3 and Furo 2024.08.06 --><title>Index - Google Gen AI SDK documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=a746c00c" />
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=8f2a1f02" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo.css?v=354aac6f" />
<link rel="stylesheet" type="text/css" href="_static/autodoc_pydantic.css?v=a0a71c94" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?v=302659d7" />
Expand Down
92 changes: 62 additions & 30 deletions docs/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/modules.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<!-- Generated with Sphinx 8.1.3 and Furo 2024.08.06 -->
<title>google - Google Gen AI SDK documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=a746c00c" />
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=8f2a1f02" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo.css?v=354aac6f" />
<link rel="stylesheet" type="text/css" href="_static/autodoc_pydantic.css?v=a0a71c94" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?v=302659d7" />
Expand Down
2 changes: 1 addition & 1 deletion docs/py-modindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="color-scheme" content="light dark"><link rel="index" title="Index" href="genindex.html" /><link rel="search" title="Search" href="search.html" />

<!-- Generated with Sphinx 8.1.3 and Furo 2024.08.06 --><title>Python Module Index - Google Gen AI SDK documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=a746c00c" />
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=8f2a1f02" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo.css?v=354aac6f" />
<link rel="stylesheet" type="text/css" href="_static/autodoc_pydantic.css?v=a0a71c94" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?v=302659d7" />
Expand Down
2 changes: 1 addition & 1 deletion docs/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<!-- Generated with Sphinx 8.1.3 and Furo 2024.08.06 -->
<meta name="robots" content="noindex" />
<title>Search - Google Gen AI SDK documentation</title><link rel="stylesheet" type="text/css" href="_static/pygments.css?v=a746c00c" />
<title>Search - Google Gen AI SDK documentation</title><link rel="stylesheet" type="text/css" href="_static/pygments.css?v=8f2a1f02" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo.css?v=354aac6f" />
<link rel="stylesheet" type="text/css" href="_static/autodoc_pydantic.css?v=a0a71c94" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?v=302659d7" />
Expand Down
2 changes: 1 addition & 1 deletion docs/searchindex.js

Large diffs are not rendered by default.

0 comments on commit 30a3493

Please sign in to comment.