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
Copy file name to clipboardExpand all lines: sample/old_version/05-GoogleGenerativeAI-(NEW).md
+2-12
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,7 @@ pre {
14
14
background-color: #027c7c;
15
15
padding-left: 0.5em;
16
16
}
17
+
17
18
</style>
18
19
19
20
# Google Generative AI
@@ -52,13 +53,11 @@ Set up the environment. You may refer to [Environment Setup](https://wikidocs.ne
52
53
-`langchain-opentutorial` is a package that provides a set of easy-to-use environment setup, useful functions and utilities for tutorials.
53
54
- You can checkout the [`langchain-opentutorial`](https://github.com/LangChain-OpenTutorial/langchain-opentutorial-pypi) for more details.
54
55
55
-
56
56
```python
57
57
%%capture --no-stderr
58
58
!pip install langchain-opentutorial
59
59
```
60
60
61
-
62
61
```python
63
62
# Install required packages
64
63
from langchain_opentutorial import package
@@ -73,7 +72,6 @@ package.install(
73
72
)
74
73
```
75
74
76
-
77
75
```python
78
76
# Set environment variables
79
77
from langchain_opentutorial import set_env
@@ -101,7 +99,6 @@ You can alternatively set `GOOGLE_API_KEY` in `.env` file and load it.
101
99
102
100
[Note] This is not necessary if you've already set `GOOGLE_API_KEY` in previous steps.
103
101
104
-
105
102
```python
106
103
from dotenv import load_dotenv
107
104
@@ -125,7 +122,6 @@ Because the `ChatGoogleGenerativeAI` class is integrated with the LangChain fram
125
122
126
123
For information about supported models, see: https://ai.google.dev/gemini-api/docs/models/gemini?hl=en
127
124
128
-
129
125
```python
130
126
from langchain_google_genai import ChatGoogleGenerativeAI
131
127
@@ -143,7 +139,6 @@ for token in answer:
143
139
LangChain is a framework for developing applications powered by large language models (LLMs). It simplifies building applications by connecting LLMs to other sources of data and computation. This enables creation of sophisticated chains of prompts and actions, going beyond single LLM calls.
144
140
145
141
146
-
147
142
```python
148
143
from langchain_google_genai import ChatGoogleGenerativeAI
149
144
from langchain_core.prompts import PromptTemplate
@@ -170,7 +165,6 @@ print(response.content)
170
165
171
166
Gemini models have default safety settings that can be overridden. If you are receiving lots of "Safety Warnings" from your models, you can try tweaking the `safety_settings` attribute of the model. For example, to turn off safety blocking for dangerous content, you can construct your LLM as follows:
172
167
173
-
174
168
```python
175
169
from langchain_google_genai import (
176
170
ChatGoogleGenerativeAI,
@@ -242,7 +236,6 @@ print(response.content)
242
236
243
237
`ChatGoogleGenerativeAI` natively supports streaming and batching. Below is an example.
244
238
245
-
246
239
```python
247
240
from langchain_google_genai import ChatGoogleGenerativeAI
248
241
@@ -289,7 +282,6 @@ for chunk in llm.stream("Can you recommend 5 travel destinations in California?"
289
282
---
290
283
291
284
292
-
293
285
```python
294
286
from langchain_google_genai import ChatGoogleGenerativeAI
295
287
@@ -324,7 +316,6 @@ To provide an image, pass a human message with contents of type `List[dict]`, wh
324
316
- A base64 encoded image (e.g., `data:image/png;base64,abcd124`)
Copy file name to clipboardExpand all lines: sample/old_version/05-GoogleGenerativeAI-(WIKIDOCS).md
+2-2
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ pre {
27
27
28
28
## Overview
29
29
30
-
You can use the `ChatGoogleGenerativeAI` class from the [langchain-google-genai](https://pypi.org/project/langchain-google-genai/) integration package to access not only Google AI¡¯s `gemini` and `gemini-vision` models, but also other generative models.
30
+
You can use the `ChatGoogleGenerativeAI` class from the [langchain-google-genai](https://pypi.org/project/langchain-google-genai/) integration package to access not only Google AI��s `gemini` and `gemini-vision` models, but also other generative models.
31
31
32
32
### Table of Contents
33
33
@@ -106,7 +106,7 @@ load_dotenv(override=True)
106
106
107
107
Import the `ChatGoogleGenerativeAI` class from the `langchain_google_genai` package.
108
108
109
-
The `ChatGoogleGenerativeAI` class is used to implement conversational AI systems using Google¡¯s Generative AI models. Through this class, users can interact with Google¡¯s conversational AI model. Conversations with the model take place in a chat format, and the model generates appropriate responses based on user input.
109
+
The `ChatGoogleGenerativeAI` class is used to implement conversational AI systems using Google��s Generative AI models. Through this class, users can interact with Google��s conversational AI model. Conversations with the model take place in a chat format, and the model generates appropriate responses based on user input.
110
110
111
111
Because the `ChatGoogleGenerativeAI` class is integrated with the LangChain framework, it can be used alongside other LangChain components.
0 commit comments