Update app.py
Browse files
app.py
CHANGED
|
@@ -865,7 +865,7 @@ def tool_executor(state: AgentState):
|
|
| 865 |
"extremely",]
|
| 866 |
webpage_information_complete = " \n ".join(texts)
|
| 867 |
else:
|
| 868 |
-
webpage_results = visit_webpage_wiki(action
|
| 869 |
webpage_result = " \n ".join(webpage_results)
|
| 870 |
|
| 871 |
# for webpage_result in webpage_results:
|
|
@@ -909,6 +909,7 @@ def tool_executor(state: AgentState):
|
|
| 909 |
pass
|
| 910 |
elif "answer" in state["proposed_action"]:
|
| 911 |
webpage_information_complete = f"""answer: {state["proposed_action"]["answer"]}"""
|
|
|
|
| 912 |
else:
|
| 913 |
webpage_information_complete = ""
|
| 914 |
|
|
@@ -918,8 +919,12 @@ def tool_executor(state: AgentState):
|
|
| 918 |
state["information"] = webpage_information_complete[:3000]
|
| 919 |
state["best_query_webpage_information_similarity_score"] = best_query_webpage_information_similarity_score
|
| 920 |
except:
|
| 921 |
-
|
| 922 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 923 |
|
| 924 |
# logger.info(f"Information: {state['information']}")
|
| 925 |
# logger.info(f"Information: {state['best_query_webpage_information_similarity_score']}")
|
|
|
|
| 865 |
"extremely",]
|
| 866 |
webpage_information_complete = " \n ".join(texts)
|
| 867 |
else:
|
| 868 |
+
webpage_results = visit_webpage_wiki(action.args["url"])
|
| 869 |
webpage_result = " \n ".join(webpage_results)
|
| 870 |
|
| 871 |
# for webpage_result in webpage_results:
|
|
|
|
| 909 |
pass
|
| 910 |
elif "answer" in state["proposed_action"]:
|
| 911 |
webpage_information_complete = f"""answer: {state["proposed_action"]["answer"]}"""
|
| 912 |
+
state["best_query_webpage_information_similarity_score"] = 1.0
|
| 913 |
else:
|
| 914 |
webpage_information_complete = ""
|
| 915 |
|
|
|
|
| 919 |
state["information"] = webpage_information_complete[:3000]
|
| 920 |
state["best_query_webpage_information_similarity_score"] = best_query_webpage_information_similarity_score
|
| 921 |
except:
|
| 922 |
+
if "answer" in state["proposed_action"]:
|
| 923 |
+
webpage_information_complete = f"""answer: {state["proposed_action"]["answer"]}"""
|
| 924 |
+
state["best_query_webpage_information_similarity_score"] = 1.0
|
| 925 |
+
else:
|
| 926 |
+
state["information"] = ""
|
| 927 |
+
state["best_query_webpage_information_similarity_score"] = -1.0
|
| 928 |
|
| 929 |
# logger.info(f"Information: {state['information']}")
|
| 930 |
# logger.info(f"Information: {state['best_query_webpage_information_similarity_score']}")
|