tuan3335 commited on
Commit
6a741f5
·
1 Parent(s): bcf2762

Sử dụng agent thực sự từ agent.py cho BasicAgent trong app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -12,6 +12,7 @@ import os
12
  import gradio as gr
13
  import requests
14
  import pandas as pd
 
15
 
16
  # --- Constants ---
17
  DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
@@ -23,9 +24,9 @@ class BasicAgent:
23
  print("BasicAgent initialized.")
24
  def __call__(self, question: str) -> str:
25
  print(f"Agent received question (first 50 chars): {question[:50]}...")
26
- fixed_answer = "This is a default answer."
27
- print(f"Agent returning fixed answer: {fixed_answer}")
28
- return fixed_answer
29
 
30
 
31
  def run_and_submit_all(profile: gr.OAuthProfile | None = None):
 
12
  import gradio as gr
13
  import requests
14
  import pandas as pd
15
+ from agent import process_question
16
 
17
  # --- Constants ---
18
  DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
 
24
  print("BasicAgent initialized.")
25
  def __call__(self, question: str) -> str:
26
  print(f"Agent received question (first 50 chars): {question[:50]}...")
27
+ answer = process_question(question)
28
+ print(f"Agent returning answer: {answer}")
29
+ return answer
30
 
31
 
32
  def run_and_submit_all(profile: gr.OAuthProfile | None = None):