Spaces:
Sleeping
Sleeping
feat: basic agent conversational answers
Browse files
app.py
CHANGED
@@ -5,20 +5,23 @@ import inspect
|
|
5 |
import pandas as pd
|
6 |
import json
|
7 |
import copy
|
8 |
-
|
9 |
|
10 |
|
11 |
DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
12 |
|
13 |
|
14 |
class BasicAgent:
|
15 |
-
# BUILD OR LOAD HERE
|
16 |
def __init__(self):
|
|
|
|
|
|
|
|
|
17 |
print("BasicAgent initialized.")
|
18 |
def __call__(self, question: str) -> str:
|
19 |
print(f"Agent received question (first 50 chars): {question[:50]}...")
|
20 |
-
|
21 |
-
print(f"Agent returning fixed answer: {
|
22 |
return fixed_answer
|
23 |
|
24 |
|
|
|
5 |
import pandas as pd
|
6 |
import json
|
7 |
import copy
|
8 |
+
from basic_agent import BasicOpenAIAgentWorkflow
|
9 |
|
10 |
|
11 |
DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
12 |
|
13 |
|
14 |
class BasicAgent:
|
|
|
15 |
def __init__(self):
|
16 |
+
self.agent = BasicOpenAIAgentWorkflow(
|
17 |
+
tools=[] # search_web_extract_info
|
18 |
+
)
|
19 |
+
self.workflow = basic_tool_agent.create_basic_tool_use_agent_state_graph()
|
20 |
print("BasicAgent initialized.")
|
21 |
def __call__(self, question: str) -> str:
|
22 |
print(f"Agent received question (first 50 chars): {question[:50]}...")
|
23 |
+
answer = self.workflow(question)
|
24 |
+
print(f"Agent returning fixed answer: {answer}")
|
25 |
return fixed_answer
|
26 |
|
27 |
|