Skip to content

Commit 1d57271

Browse files
sasha-gitgGoogler
andauthored
Project import generated by Copybara. (#24)
PiperOrigin-RevId: 707169452 Co-authored-by: Googler <noreply@google.com>
1 parent cf3c476 commit 1d57271

32 files changed

Lines changed: 959 additions & 181 deletions

README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77

88
-----
99

10+
## Installation
11+
12+
``` cmd
13+
pip install google-genai
14+
```
15+
1016
## Imports
1117

1218
``` python
@@ -427,6 +433,8 @@ response2.generated_images[0].image.show()
427433

428434
#### Edit Image
429435

436+
Edit image uses a separate model from generate and upscale.
437+
430438
Edit image is not supported in Google AI.
431439

432440
``` python
@@ -447,7 +455,7 @@ mask_ref_image = MaskReferenceImage(
447455
)
448456

449457
response3 = client.models.edit_image(
450-
model='imagen-3.0-capability-preview-0930',
458+
model='imagen-3.0-capability-001',
451459
prompt='Sunlight and clear sky',
452460
reference_images=[raw_ref_image, mask_ref_image],
453461
config=types.EditImageConfig(
@@ -514,9 +522,9 @@ cached_content = client.caches.create(
514522
file_uri=file_uris[1],
515523
mime_type='application/pdf',)])
516524
],
525+
system_instruction='What is the sum of the two pdfs?',
517526
config=types.CreateCachedContentConfig(
518527
display_name='test cache',
519-
system_instruction='What is the sum of the two pdfs?',
520528
ttl='3600s',
521529
),
522530
)
@@ -809,4 +817,4 @@ print(async_pager[0])
809817
delete_job = client.batches.delete(name=job.name)
810818

811819
delete_job
812-
```
820+
```

docs/_sources/index.rst.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ integrate Google's generative models into their Python applications. This is an
1414
early release (version 0.1.0). API is subject to change. Please do not use this
1515
SDK in production.
1616

17+
Installation
18+
============
19+
20+
.. code:: console
21+
22+
pip install google-genai
23+
1724
Imports
1825
=======
1926

docs/genai.html

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

docs/genindex.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3461,6 +3461,12 @@ <h2>T</h2>
34613461

34623462
<ul>
34633463
<li><a href="genai.html#genai.types.TuningExampleDict.text_input">(genai.types.TuningExampleDict attribute)</a>
3464+
</li>
3465+
</ul></li>
3466+
<li><a href="genai.html#genai.types.Part.thought">thought (genai.types.Part attribute)</a>
3467+
3468+
<ul>
3469+
<li><a href="genai.html#genai.types.PartDict.thought">(genai.types.PartDict attribute)</a>
34643470
</li>
34653471
</ul></li>
34663472
<li><a href="genai.html#genai.types.SafetySetting.threshold">threshold (genai.types.SafetySetting attribute)</a>

docs/index.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,12 @@ <h1>Google Gen AI SDK<a class="headerlink" href="#google-gen-ai-sdk" title="Link
276276
early release (version 0.1.0). API is subject to change. Please do not use this
277277
SDK in production.</p>
278278
</section>
279+
<section id="installation">
280+
<h1>Installation<a class="headerlink" href="#installation" title="Link to this heading"></a></h1>
281+
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">pip install google-genai</span>
282+
</pre></div>
283+
</div>
284+
</section>
279285
<section id="imports">
280286
<h1>Imports<a class="headerlink" href="#imports" title="Link to this heading"></a></h1>
281287
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">google</span> <span class="kn">import</span> <span class="n">genai</span>
@@ -2583,6 +2589,7 @@ <h1>Reference<a class="headerlink" href="#reference" title="Link to this heading
25832589
<li class="toctree-l3"><a class="reference internal" href="genai.html#genai.types.Part.function_response"><code class="docutils literal notranslate"><span class="pre">Part.function_response</span></code></a></li>
25842590
<li class="toctree-l3"><a class="reference internal" href="genai.html#genai.types.Part.inline_data"><code class="docutils literal notranslate"><span class="pre">Part.inline_data</span></code></a></li>
25852591
<li class="toctree-l3"><a class="reference internal" href="genai.html#genai.types.Part.text"><code class="docutils literal notranslate"><span class="pre">Part.text</span></code></a></li>
2592+
<li class="toctree-l3"><a class="reference internal" href="genai.html#genai.types.Part.thought"><code class="docutils literal notranslate"><span class="pre">Part.thought</span></code></a></li>
25862593
<li class="toctree-l3"><a class="reference internal" href="genai.html#genai.types.Part.video_metadata"><code class="docutils literal notranslate"><span class="pre">Part.video_metadata</span></code></a></li>
25872594
<li class="toctree-l3"><a class="reference internal" href="genai.html#genai.types.Part.from_bytes"><code class="docutils literal notranslate"><span class="pre">Part.from_bytes()</span></code></a></li>
25882595
<li class="toctree-l3"><a class="reference internal" href="genai.html#genai.types.Part.from_code_execution_result"><code class="docutils literal notranslate"><span class="pre">Part.from_code_execution_result()</span></code></a></li>
@@ -2602,6 +2609,7 @@ <h1>Reference<a class="headerlink" href="#reference" title="Link to this heading
26022609
<li class="toctree-l3"><a class="reference internal" href="genai.html#genai.types.PartDict.function_response"><code class="docutils literal notranslate"><span class="pre">PartDict.function_response</span></code></a></li>
26032610
<li class="toctree-l3"><a class="reference internal" href="genai.html#genai.types.PartDict.inline_data"><code class="docutils literal notranslate"><span class="pre">PartDict.inline_data</span></code></a></li>
26042611
<li class="toctree-l3"><a class="reference internal" href="genai.html#genai.types.PartDict.text"><code class="docutils literal notranslate"><span class="pre">PartDict.text</span></code></a></li>
2612+
<li class="toctree-l3"><a class="reference internal" href="genai.html#genai.types.PartDict.thought"><code class="docutils literal notranslate"><span class="pre">PartDict.thought</span></code></a></li>
26052613
<li class="toctree-l3"><a class="reference internal" href="genai.html#genai.types.PartDict.video_metadata"><code class="docutils literal notranslate"><span class="pre">PartDict.video_metadata</span></code></a></li>
26062614
</ul>
26072615
</li>

docs/modules.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1852,6 +1852,7 @@ <h1>google<a class="headerlink" href="#google" title="Link to this heading">¶</
18521852
<li class="toctree-l3"><a class="reference internal" href="genai.html#genai.types.Part.function_response"><code class="docutils literal notranslate"><span class="pre">Part.function_response</span></code></a></li>
18531853
<li class="toctree-l3"><a class="reference internal" href="genai.html#genai.types.Part.inline_data"><code class="docutils literal notranslate"><span class="pre">Part.inline_data</span></code></a></li>
18541854
<li class="toctree-l3"><a class="reference internal" href="genai.html#genai.types.Part.text"><code class="docutils literal notranslate"><span class="pre">Part.text</span></code></a></li>
1855+
<li class="toctree-l3"><a class="reference internal" href="genai.html#genai.types.Part.thought"><code class="docutils literal notranslate"><span class="pre">Part.thought</span></code></a></li>
18551856
<li class="toctree-l3"><a class="reference internal" href="genai.html#genai.types.Part.video_metadata"><code class="docutils literal notranslate"><span class="pre">Part.video_metadata</span></code></a></li>
18561857
<li class="toctree-l3"><a class="reference internal" href="genai.html#genai.types.Part.from_bytes"><code class="docutils literal notranslate"><span class="pre">Part.from_bytes()</span></code></a></li>
18571858
<li class="toctree-l3"><a class="reference internal" href="genai.html#genai.types.Part.from_code_execution_result"><code class="docutils literal notranslate"><span class="pre">Part.from_code_execution_result()</span></code></a></li>
@@ -1871,6 +1872,7 @@ <h1>google<a class="headerlink" href="#google" title="Link to this heading">¶</
18711872
<li class="toctree-l3"><a class="reference internal" href="genai.html#genai.types.PartDict.function_response"><code class="docutils literal notranslate"><span class="pre">PartDict.function_response</span></code></a></li>
18721873
<li class="toctree-l3"><a class="reference internal" href="genai.html#genai.types.PartDict.inline_data"><code class="docutils literal notranslate"><span class="pre">PartDict.inline_data</span></code></a></li>
18731874
<li class="toctree-l3"><a class="reference internal" href="genai.html#genai.types.PartDict.text"><code class="docutils literal notranslate"><span class="pre">PartDict.text</span></code></a></li>
1875+
<li class="toctree-l3"><a class="reference internal" href="genai.html#genai.types.PartDict.thought"><code class="docutils literal notranslate"><span class="pre">PartDict.thought</span></code></a></li>
18741876
<li class="toctree-l3"><a class="reference internal" href="genai.html#genai.types.PartDict.video_metadata"><code class="docutils literal notranslate"><span class="pre">PartDict.video_metadata</span></code></a></li>
18751877
</ul>
18761878
</li>

docs/objects.inv

10 Bytes
Binary file not shown.

docs/searchindex.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

google/genai/CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Changelog
2+
3+
## [0.3.0](https://github.com/googleapis/python-genai/compare/v0.2.2...v0.3.0) (2024-12-17)
4+
5+
6+
### BREAKING CHANGES
7+
* contents must be passed to CreateCachedContentConfig instead as a parameter to create_cached_content.
8+
9+
### Features
10+
11+
* Add support for Pydantic default value in Automatic Function Calling.
12+
* Add support for thought.
13+
* Add support for streaming chat.

google/genai/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717

1818
from .client import Client
1919

20-
__version__ = '0.2.2'
20+
__version__ = '0.3.0'
2121

2222
__all__ = ['Client']

0 commit comments

Comments
 (0)