Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,6 +4,7 @@ from langchain_google_genai import ChatGoogleGenerativeAI
|
|
| 4 |
from langchain import LLMChain, PromptTemplate
|
| 5 |
from langchain.memory import ConversationBufferMemory
|
| 6 |
from langchain_google_genai import (
|
|
|
|
| 7 |
HarmBlockThreshold,
|
| 8 |
HarmCategory,
|
| 9 |
)
|
|
@@ -38,11 +39,8 @@ memory = ConversationBufferMemory(memory_key="chat_history")
|
|
| 38 |
llm_chain = LLMChain(
|
| 39 |
llm=ChatGoogleGenerativeAI(model="gemini-1.5-flash-lastest"),
|
| 40 |
safety_settings={
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
HarmCategory.HARM_CATEGORY_SEXUALLY_EXPLICIT: HarmBlockThreshold.BLOCK_NONE,
|
| 44 |
-
HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT: HarmBlockThreshold.BLOCK_NONE,
|
| 45 |
-
},
|
| 46 |
prompt=prompt,
|
| 47 |
verbose=True,
|
| 48 |
memory=memory,
|
|
|
|
| 4 |
from langchain import LLMChain, PromptTemplate
|
| 5 |
from langchain.memory import ConversationBufferMemory
|
| 6 |
from langchain_google_genai import (
|
| 7 |
+
ChatGoogleGenerativeAI,
|
| 8 |
HarmBlockThreshold,
|
| 9 |
HarmCategory,
|
| 10 |
)
|
|
|
|
| 39 |
llm_chain = LLMChain(
|
| 40 |
llm=ChatGoogleGenerativeAI(model="gemini-1.5-flash-lastest"),
|
| 41 |
safety_settings={
|
| 42 |
+
HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT: HarmBlockThreshold.BLOCK_NONE,
|
| 43 |
+
},
|
|
|
|
|
|
|
|
|
|
| 44 |
prompt=prompt,
|
| 45 |
verbose=True,
|
| 46 |
memory=memory,
|