naman1102 commited on
Commit
defd4dc
·
1 Parent(s): 58154e2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -4,6 +4,7 @@ import requests
4
  import inspect
5
  import pandas as pd
6
  import ast
 
7
  from typing import List, Dict, Any, Optional, Annotated
8
  from langgraph.graph import Graph, StateGraph, State
9
  from langgraph.prebuilt import ToolNode
@@ -19,12 +20,12 @@ 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
- class AgentState(State):
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]], "accumulate"]
28
  needs_more_info: Annotated[bool, "input"]
29
  search_query: Annotated[str, "input"]
30
 
 
4
  import inspect
5
  import pandas as pd
6
  import ast
7
+ import operator
8
  from typing import List, Dict, Any, Optional, Annotated
9
  from langgraph.graph import Graph, StateGraph, State
10
  from langgraph.prebuilt import ToolNode
 
20
  HF_TOKEN = os.getenv("HF_TOKEN") # Make sure to set this environment variable
21
 
22
 
23
+ class AgentState(TypedDict):
24
  question: Annotated[str, "input"]
25
  current_step: Annotated[str, "input"]
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, "input"]
31