naman1102 commited on
Commit
9029749
·
1 Parent(s): b058559

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -9
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
- # from langgraph.graph import State
14
- # from typing import Annotated
15
- from typing_extensions import TypedDict, Annotated
 
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, operator.or_]
25
- current_step: Annotated[str, operator.or_]
26
- tool_output: Annotated[str, "input"]
27
- final_answer: Annotated[str, "input"]
28
  history: Annotated[List[Dict[str, str]], operator.add]
29
- needs_more_info: Annotated[bool, "input"]
30
- search_query: Annotated[str, operator.or_]
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):