naman1102 commited on
Commit
a82796c
·
1 Parent(s): 323f26e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -17,6 +17,10 @@ from typing_extensions import TypedDict
17
 
18
  def override(_, new): return new
19
 
 
 
 
 
20
  print("trial")
21
  # (Keep Constants as is)
22
  # --- Constants ---
@@ -52,8 +56,8 @@ class AgentState(TypedDict):
52
  history: Annotated[List[Dict[str, str]], operator.add]
53
  needs_more_info: Annotated[bool, override]
54
  search_query: Annotated[str, override]
55
- task_id: Annotated[str, override] # Add task_id to state
56
- logs: Annotated[Dict[str, Any], operator.add] # Add logs to state
57
 
58
  class BasicAgent:
59
  def __init__(self):
 
17
 
18
  def override(_, new): return new
19
 
20
+ def merge_dicts(dict1: Dict, dict2: Dict) -> Dict:
21
+ """Merge two dictionaries, with values from dict2 taking precedence."""
22
+ return {**dict1, **dict2}
23
+
24
  print("trial")
25
  # (Keep Constants as is)
26
  # --- Constants ---
 
56
  history: Annotated[List[Dict[str, str]], operator.add]
57
  needs_more_info: Annotated[bool, override]
58
  search_query: Annotated[str, override]
59
+ task_id: Annotated[str, override]
60
+ logs: Annotated[Dict[str, Any], merge_dicts] # Use merge_dicts instead of operator.add
61
 
62
  class BasicAgent:
63
  def __init__(self):