Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -18,15 +18,18 @@ class BasicAgent:
|
|
| 18 |
def __init__(self):
|
| 19 |
print("BasicAgent initialized.")
|
| 20 |
self.agent_graph = build_graph()
|
| 21 |
-
def __call__(self, input:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
print(f"Agent received question (first 50 chars): {question[:50]}...")
|
| 23 |
|
| 24 |
messages = [HumanMessage(content=f"Can you answer this question please ? {question}")]
|
| 25 |
|
| 26 |
-
|
| 27 |
-
file_name = input.get("file_name", "")
|
| 28 |
messages = self.agent_graph.invoke(
|
| 29 |
-
input={"messages": messages, "question": question, "input_file": file_name},
|
| 30 |
config={
|
| 31 |
"recursion_limit": 10,
|
| 32 |
"callbacks": [langfuse_handler]
|
|
|
|
| 18 |
def __init__(self):
|
| 19 |
print("BasicAgent initialized.")
|
| 20 |
self.agent_graph = build_graph()
|
| 21 |
+
def __call__(self, input: dict) -> str:
|
| 22 |
+
print(input)
|
| 23 |
+
question = input.get("question", "No question provided")
|
| 24 |
+
file_name = input.get("file_name", "")
|
| 25 |
+
|
| 26 |
print(f"Agent received question (first 50 chars): {question[:50]}...")
|
| 27 |
|
| 28 |
messages = [HumanMessage(content=f"Can you answer this question please ? {question}")]
|
| 29 |
|
| 30 |
+
|
|
|
|
| 31 |
messages = self.agent_graph.invoke(
|
| 32 |
+
input={"messages": messages, "question": question, "input_file": file_name},
|
| 33 |
config={
|
| 34 |
"recursion_limit": 10,
|
| 35 |
"callbacks": [langfuse_handler]
|