Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,7 +4,7 @@ import requests
|
|
| 4 |
import inspect
|
| 5 |
import pandas as pd
|
| 6 |
from langgraph.prebuilt import ToolNode, create_react_agent
|
| 7 |
-
|
| 8 |
|
| 9 |
# from typing import Any, Dict
|
| 10 |
# from typing import TypedDict, Annotated
|
|
@@ -34,9 +34,11 @@ class AgentState(TypedDict, total=False):
|
|
| 34 |
# --- Constants ---
|
| 35 |
DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
| 36 |
|
|
|
|
|
|
|
| 37 |
|
| 38 |
llm = ChatOpenAI(model_name="gpt-4.1-mini", temperature=0.0)
|
| 39 |
-
|
| 40 |
agent = create_react_agent(model=llm, tools=tool_node)
|
| 41 |
|
| 42 |
# 2) Build a two‐edge graph:
|
|
|
|
| 4 |
import inspect
|
| 5 |
import pandas as pd
|
| 6 |
from langgraph.prebuilt import ToolNode, create_react_agent
|
| 7 |
+
|
| 8 |
|
| 9 |
# from typing import Any, Dict
|
| 10 |
# from typing import TypedDict, Annotated
|
|
|
|
| 34 |
# --- Constants ---
|
| 35 |
DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
| 36 |
|
| 37 |
+
from tools import web_search, parse_excel, ocr_image
|
| 38 |
+
tool_node = ToolNode([ocr_image, parse_excel, web_search])
|
| 39 |
|
| 40 |
llm = ChatOpenAI(model_name="gpt-4.1-mini", temperature=0.0)
|
| 41 |
+
|
| 42 |
agent = create_react_agent(model=llm, tools=tool_node)
|
| 43 |
|
| 44 |
# 2) Build a two‐edge graph:
|