Spaces:
Sleeping
Sleeping
Sử dụng agent thực sự từ agent.py cho BasicAgent trong app.py
Browse files
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 |
-
|
| 27 |
-
print(f"Agent returning
|
| 28 |
-
return
|
| 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):
|