AC-Angelo93 commited on
Commit
dbc9a1d
·
verified ·
1 Parent(s): a259fb1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -3
app.py CHANGED
@@ -3,13 +3,22 @@ import gradio as gr
3
  import requests
4
  import inspect
5
  import pandas as pd
6
- from agent import BasicAgent
7
-
8
  # (Keep Constants as is)
9
  # --- Constants ---
10
  DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
11
 
12
-
 
 
 
 
 
 
 
 
 
 
13
 
14
  def run_and_submit_all( profile: gr.OAuthProfile | None):
15
  """
 
3
  import requests
4
  import inspect
5
  import pandas as pd
6
+ from agent import build_graph
 
7
  # (Keep Constants as is)
8
  # --- Constants ---
9
  DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
10
 
11
+ # --- Basic Agent Definition ---
12
+ # ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
13
+ class BasicAgent:
14
+ def __init__(self):
15
+ # graph factory lives here
16
+ self.graph = build_graph()
17
+
18
+ def __call__(self, question: str) -> str:
19
+ # runs graph on each question
20
+ answer = self.graph.run(question)
21
+ return enswer.replace("FINAL ANSWER:","",1).strip()
22
 
23
  def run_and_submit_all( profile: gr.OAuthProfile | None):
24
  """