naman1102 commited on
Commit
7e21665
·
1 Parent(s): 3c3a81f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -42,15 +42,16 @@ class BasicAgent:
42
  }
43
 
44
  # Create the agent workflow
 
45
  self.workflow = self._create_workflow()
46
  print("BasicAgent initialization complete.")
47
 
48
  def _create_workflow(self) -> Graph:
49
  """Create the agent workflow using LangGraph."""
50
  # Create the workflow with state schema
51
- print("Creating workflow: error happens here?")
52
  workflow = StateGraph(state_schema= AgentState)
53
-
54
  # Add nodes
55
  workflow.add_node("analyze", self._analyze_question)
56
  workflow.add_node("calculator", self._use_calculator)
@@ -222,7 +223,7 @@ def run_and_submit_all(profile: gr.OAuthProfile | None):
222
  """
223
  # --- Determine HF Space Runtime URL and Repo URL ---
224
  space_id = os.getenv("SPACE_ID") # Get the SPACE_ID for sending link to the code
225
-
226
  if profile:
227
  username = f"{profile.username}"
228
  print(f"User logged in: {username}")
@@ -236,6 +237,7 @@ def run_and_submit_all(profile: gr.OAuthProfile | None):
236
 
237
  # 1. Instantiate Agent
238
  try:
 
239
  agent = BasicAgent()
240
  print("Agent initialized successfully with workflow.")
241
  except Exception as e:
 
42
  }
43
 
44
  # Create the agent workflow
45
+ print("Creating workflow variable")
46
  self.workflow = self._create_workflow()
47
  print("BasicAgent initialization complete.")
48
 
49
  def _create_workflow(self) -> Graph:
50
  """Create the agent workflow using LangGraph."""
51
  # Create the workflow with state schema
52
+ print("Creating Stategraph : error happens here?")
53
  workflow = StateGraph(state_schema= AgentState)
54
+ print("Stategraph created")
55
  # Add nodes
56
  workflow.add_node("analyze", self._analyze_question)
57
  workflow.add_node("calculator", self._use_calculator)
 
223
  """
224
  # --- Determine HF Space Runtime URL and Repo URL ---
225
  space_id = os.getenv("SPACE_ID") # Get the SPACE_ID for sending link to the code
226
+ print("Space ID: ", space_id)
227
  if profile:
228
  username = f"{profile.username}"
229
  print(f"User logged in: {username}")
 
237
 
238
  # 1. Instantiate Agent
239
  try:
240
+ print("Initializing agent: trial ")
241
  agent = BasicAgent()
242
  print("Agent initialized successfully with workflow.")
243
  except Exception as e: