upgraded internet problem

This commit is contained in:
saloui 2024-05-23 15:53:59 +02:00
parent 4e37a58559
commit 8bc8443a9e
2 changed files with 9 additions and 4 deletions

View File

@ -848,12 +848,16 @@ class LollmsApplication(LoLLMsCom):
else:
self.personality.step_start("Performing Internet search (advanced mode: slower but more advanced)")
internet_search_results=f"!@>instructions: Use the internet search results data to answer {self.config.user_name}. Try to extract information from the websearch and use it to perform the requested task or answer the question. Try to stick to the websearch results and clarify if your answer was based on the resuts or on your own culture. If you don't know how to perform the task, then tell the user politely that you need more data inputs.\n!@>Web search results:\n"
internet_search_results=f"!@>instructions: Use the web search results data to answer {self.config.user_name}. Try to extract information from the web search and use it to perform the requested task or answer the question. Do not come up with information that is not in the websearch results. Try to stick to the websearch results and clarify if your answer was based on the resuts or on your own culture. If you don't know how to perform the task, then tell the user politely that you need more data inputs.\n!@>Web search results:\n"
docs, sorted_similarities, document_ids = self.personality.internet_search_with_vectorization(query, self.config.internet_quick_search)
if len(docs)>0:
for doc, infos,document_id in zip(docs, sorted_similarities, document_ids):
internet_search_infos.append(document_id)
internet_search_results += f"!@>search result chunk:\nchunk_infos:{document_id['url']}\nchunk_title:{document_id['title']}\ncontent:{doc}\n"
else:
internet_search_results += "The search response was empty!\nFailed to recover useful information from the search engine.\n"
if self.config.internet_quick_search:
self.personality.step_end("Performing Internet search (quick mode)")
else:

View File

@ -336,6 +336,7 @@ def internet_search_with_vectorization(query, chromedriver_path=None, internet_n
)
for i, result in enumerate(results):
ASCIIColors.orange(f"Processing result:{result['title']}")
title = result["title"]
brief = result["brief"]
href = result["href"]