Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,14 +7,14 @@ import time
|
|
| 7 |
import mimetypes
|
| 8 |
import pandas as pd
|
| 9 |
|
| 10 |
-
#
|
| 11 |
from langchain_community.chat_models import ChatOpenAI
|
| 12 |
from langgraph.graph import StateGraph, END
|
| 13 |
from langgraph.prebuilt import create_react_agent
|
| 14 |
|
| 15 |
st.set_page_config(page_title="PDF Tools", layout="wide")
|
| 16 |
|
| 17 |
-
# -------- LLM Model Setup
|
| 18 |
MODELS = {
|
| 19 |
"OpenAI GPT-4.1": {
|
| 20 |
"api_url": "https://api.openai.com/v1/chat/completions",
|
|
@@ -326,6 +326,7 @@ def build_decision_agent():
|
|
| 326 |
model="gpt-4-1106-preview",
|
| 327 |
temperature=0,
|
| 328 |
streaming=False,
|
|
|
|
| 329 |
)
|
| 330 |
tools = [
|
| 331 |
{
|
|
@@ -343,7 +344,7 @@ def build_decision_agent():
|
|
| 343 |
graph_builder.add_edge(agent, END)
|
| 344 |
return graph_builder.compile()
|
| 345 |
|
| 346 |
-
if extracted_info and po_df is not None:
|
| 347 |
if st.button("Make a decision (AI Agent)"):
|
| 348 |
with st.spinner("Reasoning and making a decision with LangGraph agent..."):
|
| 349 |
agent_graph = build_decision_agent()
|
|
|
|
| 7 |
import mimetypes
|
| 8 |
import pandas as pd
|
| 9 |
|
| 10 |
+
# LangChain & LangGraph
|
| 11 |
from langchain_community.chat_models import ChatOpenAI
|
| 12 |
from langgraph.graph import StateGraph, END
|
| 13 |
from langgraph.prebuilt import create_react_agent
|
| 14 |
|
| 15 |
st.set_page_config(page_title="PDF Tools", layout="wide")
|
| 16 |
|
| 17 |
+
# -------- LLM Model Setup --------
|
| 18 |
MODELS = {
|
| 19 |
"OpenAI GPT-4.1": {
|
| 20 |
"api_url": "https://api.openai.com/v1/chat/completions",
|
|
|
|
| 326 |
model="gpt-4-1106-preview",
|
| 327 |
temperature=0,
|
| 328 |
streaming=False,
|
| 329 |
+
# No 'tools' param, classic ReAct only!
|
| 330 |
)
|
| 331 |
tools = [
|
| 332 |
{
|
|
|
|
| 344 |
graph_builder.add_edge(agent, END)
|
| 345 |
return graph_builder.compile()
|
| 346 |
|
| 347 |
+
if extracted_info is not None and po_df is not None:
|
| 348 |
if st.button("Make a decision (AI Agent)"):
|
| 349 |
with st.spinner("Reasoning and making a decision with LangGraph agent..."):
|
| 350 |
agent_graph = build_decision_agent()
|