Commit
·
9765233
1
Parent(s):
9b65f54
update to agent invokation based on langgraph
Browse files
app.py
CHANGED
|
@@ -17,14 +17,14 @@ langfuse_handler = CallbackHandler()
|
|
| 17 |
DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
| 18 |
|
| 19 |
# --- Basic Agent Definition ---
|
| 20 |
-
# ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
|
| 21 |
class BasicAgent:
|
| 22 |
def __init__(self):
|
| 23 |
self.agent = build_graph()
|
| 24 |
print("BasicAgent initialized.")
|
| 25 |
async def aquery(self, question: str) -> str:
|
| 26 |
print(f"Agent received question (first 50 chars): {question[:50]}...")
|
| 27 |
-
response = await self.agent.
|
| 28 |
print(f"Agent returning fixed answer: {response}")
|
| 29 |
return response
|
| 30 |
|
|
|
|
| 17 |
DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
| 18 |
|
| 19 |
# --- Basic Agent Definition ---
|
| 20 |
+
# ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
|
| 21 |
class BasicAgent:
|
| 22 |
def __init__(self):
|
| 23 |
self.agent = build_graph()
|
| 24 |
print("BasicAgent initialized.")
|
| 25 |
async def aquery(self, question: str) -> str:
|
| 26 |
print(f"Agent received question (first 50 chars): {question[:50]}...")
|
| 27 |
+
response = await self.agent.invoke(question, config={"callbacks": [langfuse_handler]})
|
| 28 |
print(f"Agent returning fixed answer: {response}")
|
| 29 |
return response
|
| 30 |
|