Update app.py
Browse files
app.py
CHANGED
|
@@ -518,17 +518,15 @@ def safety_node(state: AgentState):
|
|
| 518 |
information = state["information"]
|
| 519 |
|
| 520 |
prompt = f"""
|
| 521 |
-
You are a
|
| 522 |
|
| 523 |
-
You must reason over the user request and the provided information and output the answer to the user's request. Reason well over the information provided, if any, and output the answer
|
| 524 |
|
| 525 |
You MUST ONLY return EXACTLY the answer to the user's question in the following format:
|
| 526 |
Response: <answer>
|
| 527 |
|
| 528 |
DO NOT add anything additional and return ONLY what is asked and in the format asked.
|
| 529 |
|
| 530 |
-
ONLY return a response if you are confident about the answer, otherwise return empty string.
|
| 531 |
-
|
| 532 |
If you output anything else, it is incorrect.
|
| 533 |
|
| 534 |
If there is no information provided or the information is not relevant then answer as best based on your own knowledge.
|
|
@@ -549,8 +547,6 @@ Information:
|
|
| 549 |
raw_output = reasoning_generate(prompt)
|
| 550 |
# raw_output = generate(prompt)
|
| 551 |
|
| 552 |
-
state["raw_output"] = raw_output
|
| 553 |
-
|
| 554 |
logger.info(f"Raw Output: {raw_output}")
|
| 555 |
|
| 556 |
# output = raw_output.split("Response:")[-1].strip()
|
|
@@ -1027,12 +1023,12 @@ class BasicAgent:
|
|
| 1027 |
|
| 1028 |
try:
|
| 1029 |
response = self.safe_app.invoke(state)
|
| 1030 |
-
agent_answer = response["output"]
|
| 1031 |
|
| 1032 |
if "answer: " in response["information"]:
|
| 1033 |
response["output"] = response["information"].split("answer: ")[-1].strip()
|
| 1034 |
|
| 1035 |
-
agent_answer =
|
|
|
|
| 1036 |
|
| 1037 |
# agent_answer = str(df)
|
| 1038 |
# agent_answer = str(response.status_code) + " - " + task_id
|
|
|
|
| 518 |
information = state["information"]
|
| 519 |
|
| 520 |
prompt = f"""
|
| 521 |
+
You are a reasoning agent who takes into account the provided information, if available, and answers to the user request.
|
| 522 |
|
| 523 |
+
You must reason over the user request and the provided information and output the answer to the user's request. Reason well over the information provided, if any, and output the answer to the user's question exactly.
|
| 524 |
|
| 525 |
You MUST ONLY return EXACTLY the answer to the user's question in the following format:
|
| 526 |
Response: <answer>
|
| 527 |
|
| 528 |
DO NOT add anything additional and return ONLY what is asked and in the format asked.
|
| 529 |
|
|
|
|
|
|
|
| 530 |
If you output anything else, it is incorrect.
|
| 531 |
|
| 532 |
If there is no information provided or the information is not relevant then answer as best based on your own knowledge.
|
|
|
|
| 547 |
raw_output = reasoning_generate(prompt)
|
| 548 |
# raw_output = generate(prompt)
|
| 549 |
|
|
|
|
|
|
|
| 550 |
logger.info(f"Raw Output: {raw_output}")
|
| 551 |
|
| 552 |
# output = raw_output.split("Response:")[-1].strip()
|
|
|
|
| 1023 |
|
| 1024 |
try:
|
| 1025 |
response = self.safe_app.invoke(state)
|
|
|
|
| 1026 |
|
| 1027 |
if "answer: " in response["information"]:
|
| 1028 |
response["output"] = response["information"].split("answer: ")[-1].strip()
|
| 1029 |
|
| 1030 |
+
agent_answer = response["output"]
|
| 1031 |
+
# agent_answer = str(response)
|
| 1032 |
|
| 1033 |
# agent_answer = str(df)
|
| 1034 |
# agent_answer = str(response.status_code) + " - " + task_id
|