Update app.py
Browse files
app.py
CHANGED
@@ -4,14 +4,14 @@ import requests
|
|
4 |
import inspect
|
5 |
import pandas as pd
|
6 |
import ast
|
7 |
-
from typing import TypedDict, List, Dict, Any, Optional
|
8 |
from langgraph.graph import Graph, StateGraph
|
9 |
from langgraph.prebuilt import ToolNode
|
10 |
from tools import simple_search
|
11 |
from huggingface_hub import InferenceClient
|
12 |
# from langgraph.graph import State
|
13 |
# from typing import Annotated
|
14 |
-
from typing_extensions import TypedDict
|
15 |
print("trial")
|
16 |
# (Keep Constants as is)
|
17 |
# --- Constants ---
|
@@ -19,16 +19,14 @@ DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
|
19 |
HF_TOKEN = os.getenv("HF_TOKEN") # Make sure to set this environment variable
|
20 |
|
21 |
|
22 |
-
from typing import TypedDict, List, Dict
|
23 |
-
|
24 |
class AgentState(TypedDict):
|
25 |
-
question: str
|
26 |
-
current_step: str
|
27 |
-
tool_output: str
|
28 |
-
final_answer: str
|
29 |
-
history: List[Dict[str, str]]
|
30 |
-
needs_more_info: bool
|
31 |
-
search_query: str
|
32 |
|
33 |
class BasicAgent:
|
34 |
def __init__(self):
|
|
|
4 |
import inspect
|
5 |
import pandas as pd
|
6 |
import ast
|
7 |
+
from typing import TypedDict, List, Dict, Any, Optional, Annotated
|
8 |
from langgraph.graph import Graph, StateGraph
|
9 |
from langgraph.prebuilt import ToolNode
|
10 |
from tools import simple_search
|
11 |
from huggingface_hub import InferenceClient
|
12 |
# from langgraph.graph import State
|
13 |
# from typing import Annotated
|
14 |
+
from typing_extensions import TypedDict, Annotated
|
15 |
print("trial")
|
16 |
# (Keep Constants as is)
|
17 |
# --- Constants ---
|
|
|
19 |
HF_TOKEN = os.getenv("HF_TOKEN") # Make sure to set this environment variable
|
20 |
|
21 |
|
|
|
|
|
22 |
class AgentState(TypedDict):
|
23 |
+
question: Annotated[str, "input"]
|
24 |
+
current_step: Annotated[str, "input"]
|
25 |
+
tool_output: Annotated[str, "input"]
|
26 |
+
final_answer: Annotated[str, "input"]
|
27 |
+
history: Annotated[List[Dict[str, str]], "input"]
|
28 |
+
needs_more_info: Annotated[bool, "input"]
|
29 |
+
search_query: Annotated[str, "input"]
|
30 |
|
31 |
class BasicAgent:
|
32 |
def __init__(self):
|