removed un necessary changes

This commit is contained in:
pratiksinghchauhan
2023-04-10 12:31:37 +05:30
parent 13467259b4
commit 156739788a
2 changed files with 27 additions and 16 deletions

View File

@@ -106,6 +106,8 @@ def execute_command(command_name, arguments):
return execute_python_file(arguments["file"])
elif command_name == "generate_image":
return generate_image(arguments["prompt"])
elif command_name == "do_nothing":
return "No action performed."
elif command_name == "task_complete":
shutdown()
else:
@@ -163,9 +165,8 @@ def google_official_search(query, num_results=8):
return search_results_links
def browse_website(url, question):
website_content = browse.get_website_content(url)
summary = get_text_summary(website_content, question)
links = get_hyperlinks(website_content)
summary = get_text_summary(url, question)
links = get_hyperlinks(url)
# Limit links to 5
if len(links) > 5:
@@ -176,14 +177,14 @@ def browse_website(url, question):
return result
def get_text_summary(website_content, question):
text = browse.scrape_text(website_content)
def get_text_summary(url, question):
text = browse.scrape_text(url)
summary = browse.summarize_text(text, question)
return """ "Result" : """ + summary
def get_hyperlinks(website_content):
link_list = browse.scrape_links(website_content)
def get_hyperlinks(url):
link_list = browse.scrape_links(url)
return link_list