selim-ba commited on
Commit
88583e7
·
verified ·
1 Parent(s): a1299ac

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -9
app.py CHANGED
@@ -5,6 +5,7 @@ import inspect
5
  import pandas as pd
6
 
7
  from langgraph.graph import StateGraph, END
 
8
 
9
 
10
  # (Keep Constants as is)
@@ -67,15 +68,13 @@ class SuperSmartAgent:
67
  state["response"] = "This question doesn't require Python or is unclear."
68
  return state
69
 
70
- # State schema
71
- state_schema = {
72
- "question": str,
73
- "is_reversed": bool,
74
- "is_python": bool,
75
- "response": str,
76
- }
77
-
78
- builder = StateGraph(state_schema)
79
 
80
  # Nodes
81
  builder.add_node("check_reversed", check_reversed)
 
5
  import pandas as pd
6
 
7
  from langgraph.graph import StateGraph, END
8
+ from typing import TypedDict
9
 
10
 
11
  # (Keep Constants as is)
 
68
  state["response"] = "This question doesn't require Python or is unclear."
69
  return state
70
 
71
+ class AgentState(TypedDict):
72
+ question: str
73
+ is_reversed: bool
74
+ is_python: bool
75
+ response: str
76
+
77
+ builder = StateGraph(AgentState)
 
 
78
 
79
  # Nodes
80
  builder.add_node("check_reversed", check_reversed)