Spaces:
Sleeping
Sleeping
Upload 2 files
Browse files- app.py +10 -2
- requirements.txt +14 -0
app.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from langchain_core.prompts import ChatPromptTemplate
|
| 3 |
-
from langchain_openai import ChatOpenAI
|
|
|
|
| 4 |
from langgraph.graph import StateGraph, END
|
| 5 |
from typing import Dict, List
|
| 6 |
|
|
@@ -9,7 +10,14 @@ def agent_node(state):
|
|
| 9 |
prompt = ChatPromptTemplate.from_messages(
|
| 10 |
[("user", "{user_input}")]
|
| 11 |
)
|
| 12 |
-
model = ChatOpenAI()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
response = model.invoke(prompt.format_messages(**state))
|
| 14 |
return {"response": response.content}
|
| 15 |
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from langchain_core.prompts import ChatPromptTemplate
|
| 3 |
+
#from langchain_openai import ChatOpenAI
|
| 4 |
+
from langchain_google_genai import ChatGoogleGenerativeAI
|
| 5 |
from langgraph.graph import StateGraph, END
|
| 6 |
from typing import Dict, List
|
| 7 |
|
|
|
|
| 10 |
prompt = ChatPromptTemplate.from_messages(
|
| 11 |
[("user", "{user_input}")]
|
| 12 |
)
|
| 13 |
+
#model = ChatOpenAI()
|
| 14 |
+
model = ChatGoogleGenerativeAI(model="gemini-2.0-flash",
|
| 15 |
+
temperature=0,
|
| 16 |
+
max_tokens=None,
|
| 17 |
+
timeout=None,
|
| 18 |
+
max_retries=2,
|
| 19 |
+
# other params...
|
| 20 |
+
)
|
| 21 |
response = model.invoke(prompt.format_messages(**state))
|
| 22 |
return {"response": response.content}
|
| 23 |
|
requirements.txt
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
aiofiles==23.2.1
|
| 2 |
annotated-types==0.7.0
|
| 3 |
anyio==4.9.0
|
|
|
|
| 4 |
certifi==2025.1.31
|
| 5 |
charset-normalizer==3.4.1
|
| 6 |
click==8.1.8
|
|
@@ -8,11 +9,18 @@ distro==1.9.0
|
|
| 8 |
fastapi==0.115.12
|
| 9 |
ffmpy==0.5.0
|
| 10 |
filelock==3.18.0
|
|
|
|
| 11 |
fsspec==2025.3.2
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
gradio==5.23.2
|
| 13 |
gradio_client==1.8.0
|
| 14 |
greenlet==3.1.1
|
| 15 |
groovy==0.1.2
|
|
|
|
|
|
|
| 16 |
h11==0.14.0
|
| 17 |
httpcore==1.0.7
|
| 18 |
httpx==0.28.1
|
|
@@ -24,6 +32,7 @@ jsonpatch==1.33
|
|
| 24 |
jsonpointer==3.0.0
|
| 25 |
langchain==0.3.22
|
| 26 |
langchain-core==0.3.49
|
|
|
|
| 27 |
langchain-openai==0.3.11
|
| 28 |
langchain-text-splitters==0.3.7
|
| 29 |
langgraph==0.3.21
|
|
@@ -41,6 +50,10 @@ ormsgpack==1.9.1
|
|
| 41 |
packaging==24.2
|
| 42 |
pandas==2.2.3
|
| 43 |
pillow==11.1.0
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
pydantic==2.11.1
|
| 45 |
pydantic_core==2.33.0
|
| 46 |
pydub==0.25.1
|
|
@@ -53,6 +66,7 @@ regex==2024.11.6
|
|
| 53 |
requests==2.32.3
|
| 54 |
requests-toolbelt==1.0.0
|
| 55 |
rich==14.0.0
|
|
|
|
| 56 |
ruff==0.11.2
|
| 57 |
safehttpx==0.1.6
|
| 58 |
semantic-version==2.10.0
|
|
|
|
| 1 |
aiofiles==23.2.1
|
| 2 |
annotated-types==0.7.0
|
| 3 |
anyio==4.9.0
|
| 4 |
+
cachetools==5.5.2
|
| 5 |
certifi==2025.1.31
|
| 6 |
charset-normalizer==3.4.1
|
| 7 |
click==8.1.8
|
|
|
|
| 9 |
fastapi==0.115.12
|
| 10 |
ffmpy==0.5.0
|
| 11 |
filelock==3.18.0
|
| 12 |
+
filetype==1.2.0
|
| 13 |
fsspec==2025.3.2
|
| 14 |
+
google-ai-generativelanguage==0.6.17
|
| 15 |
+
google-api-core==2.24.2
|
| 16 |
+
google-auth==2.38.0
|
| 17 |
+
googleapis-common-protos==1.69.2
|
| 18 |
gradio==5.23.2
|
| 19 |
gradio_client==1.8.0
|
| 20 |
greenlet==3.1.1
|
| 21 |
groovy==0.1.2
|
| 22 |
+
grpcio==1.71.0
|
| 23 |
+
grpcio-status==1.71.0
|
| 24 |
h11==0.14.0
|
| 25 |
httpcore==1.0.7
|
| 26 |
httpx==0.28.1
|
|
|
|
| 32 |
jsonpointer==3.0.0
|
| 33 |
langchain==0.3.22
|
| 34 |
langchain-core==0.3.49
|
| 35 |
+
langchain-google-genai==2.1.2
|
| 36 |
langchain-openai==0.3.11
|
| 37 |
langchain-text-splitters==0.3.7
|
| 38 |
langgraph==0.3.21
|
|
|
|
| 50 |
packaging==24.2
|
| 51 |
pandas==2.2.3
|
| 52 |
pillow==11.1.0
|
| 53 |
+
proto-plus==1.26.1
|
| 54 |
+
protobuf==5.29.4
|
| 55 |
+
pyasn1==0.6.1
|
| 56 |
+
pyasn1_modules==0.4.2
|
| 57 |
pydantic==2.11.1
|
| 58 |
pydantic_core==2.33.0
|
| 59 |
pydub==0.25.1
|
|
|
|
| 66 |
requests==2.32.3
|
| 67 |
requests-toolbelt==1.0.0
|
| 68 |
rich==14.0.0
|
| 69 |
+
rsa==4.9
|
| 70 |
ruff==0.11.2
|
| 71 |
safehttpx==0.1.6
|
| 72 |
semantic-version==2.10.0
|