Update app.py
Browse files
app.py
CHANGED
@@ -10,9 +10,10 @@ from langgraph.graph import Graph, StateGraph
|
|
10 |
from langgraph.prebuilt import ToolNode
|
11 |
from tools import simple_search
|
12 |
from huggingface_hub import InferenceClient
|
13 |
-
|
14 |
-
|
15 |
-
|
|
|
16 |
print("trial")
|
17 |
# (Keep Constants as is)
|
18 |
# --- Constants ---
|
@@ -21,13 +22,13 @@ HF_TOKEN = os.getenv("HF_TOKEN") # Make sure to set this environment variable
|
|
21 |
|
22 |
|
23 |
class AgentState(TypedDict):
|
24 |
-
question: Annotated[str,
|
25 |
-
current_step: Annotated[str,
|
26 |
-
tool_output: Annotated[str,
|
27 |
-
final_answer: Annotated[str,
|
28 |
history: Annotated[List[Dict[str, str]], operator.add]
|
29 |
-
needs_more_info: Annotated[bool,
|
30 |
-
search_query: Annotated[str,
|
31 |
|
32 |
class BasicAgent:
|
33 |
def __init__(self):
|
|
|
10 |
from langgraph.prebuilt import ToolNode
|
11 |
from tools import simple_search
|
12 |
from huggingface_hub import InferenceClient
|
13 |
+
from typing_extensions import TypedDict
|
14 |
+
|
15 |
+
def override(_, new): return new
|
16 |
+
|
17 |
print("trial")
|
18 |
# (Keep Constants as is)
|
19 |
# --- Constants ---
|
|
|
22 |
|
23 |
|
24 |
class AgentState(TypedDict):
|
25 |
+
question: Annotated[str, override]
|
26 |
+
current_step: Annotated[str, override]
|
27 |
+
tool_output: Annotated[str, override]
|
28 |
+
final_answer: Annotated[str, override]
|
29 |
history: Annotated[List[Dict[str, str]], operator.add]
|
30 |
+
needs_more_info: Annotated[bool, override]
|
31 |
+
search_query: Annotated[str, override]
|
32 |
|
33 |
class BasicAgent:
|
34 |
def __init__(self):
|