naman1102 commited on
Commit
6a3097f
·
1 Parent(s): 3de0d3b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -9
app.py CHANGED
@@ -4,9 +4,8 @@ import requests
4
  import inspect
5
  import pandas as pd
6
  import ast
7
- from typing import Annotated, TypedDict, List, Dict, Any, Optional
8
  from langgraph.graph import Graph, StateGraph
9
- from langgraph.graph.state import State
10
  from langgraph.prebuilt import ToolNode
11
  from tools import simple_search
12
  from huggingface_hub import InferenceClient
@@ -18,13 +17,13 @@ DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
18
  HF_TOKEN = os.getenv("HF_TOKEN") # Make sure to set this environment variable
19
 
20
  class AgentState(TypedDict):
21
- question: Annotated[str, State.Immutable] # Fixed across steps
22
- current_step: str # Mutable
23
- tool_output: str # Mutable
24
- final_answer: str # Mutable
25
- history: Annotated[List[Dict[str, str]], State.MergingList] # Merged across steps
26
- needs_more_info: bool # Mutable
27
- search_query: str # Mutable
28
 
29
  class BasicAgent:
30
  def __init__(self):
 
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
 
17
  HF_TOKEN = os.getenv("HF_TOKEN") # Make sure to set this environment variable
18
 
19
  class AgentState(TypedDict):
20
+ question: str # Fixed across steps
21
+ current_step: str # Mutable
22
+ tool_output: str # Mutable
23
+ final_answer: str # Mutable
24
+ history: List[Dict[str, str]] # Merged across steps
25
+ needs_more_info: bool # Mutable
26
+ search_query: str # Mutable
27
 
28
  class BasicAgent:
29
  def __init__(self):