You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 12, 2024. It is now read-only.
response = GeminiClient.generate_content("What does the text in this image say?", image=image)
305
+
response.response_dict
306
+
```
298
307
299
308
<br>
300
309
301
310
### # 07. Generate content using Google Services
311
+
To begin, you must link Google Workspace to activate this extension via the [Gemini web extension](https://gemini.google.com/extensions). Please refer to the [official notice](https://support.google.com/gemini/answer/13695044) and review the [privacy policies](https://support.google.com/gemini/answer/13594961?visit_id=638457301410420313-1578971242&p=privacy_help&rd=1) for more details.
You can specify a particular response by setting its Response Choice ID (RCID).
354
+
355
+
```python
356
+
# Generate content for the prompt "Give me some information about the USA."
357
+
response1 = GeminiClient.generate_content("Give me some information about the USA.")
358
+
# After reviewing the responses, choose the one you prefer and copy its RCID.
359
+
GeminiClient.rcid ="rc_xxxx"
360
+
361
+
# Now, generate content for the next prompt "How long does it take from LA to New York?"
362
+
response2 = GeminiClient.generate_content("How long does it take from LA to New York?")
363
+
```
364
+
365
+
<br>
366
+
367
+
### # 09. Changing the Selected Response from 0 to n
368
+
In Gemini, generate_content returns the first response. This may vary depending on length or sorting. Therefore, you can specify the index of the chosen response from 0 to n as follows. However, if there is only one response, revert it back to 0.
369
+
```python
370
+
from gemini import GeminiModelOutput
371
+
GeminiModelOutput.chosen =1# default is 0
372
+
response1 = GeminiClient.generate_content("Give me some information about the USA.")
373
+
```
374
+
375
+
305
376
## Further
306
377
307
378
### Use rotating proxies
@@ -412,7 +483,7 @@ Core maintainers:
412
483
413
484
414
485
## License
415
-
[MIT](https://opensource.org/license/mit/) license, 2024, Minwoo(Daniel) Park. We hereby strongly disclaim any explicit or implicit legal liability related to our works. Users are required to use this package responsibly and at their own risk. This project is a personal initiative and is not affiliated with or endorsed by Google. It is recommended to use Google's official API.
486
+
[MIT](https://opensource.org/license/mit/) license, 2024. We hereby strongly disclaim any explicit or implicit legal liability related to our works. Users are required to use this package responsibly and at their own risk. This project is a personal initiative and is not affiliated with or endorsed by Google. It is recommended to use Google's official API.
0 commit comments