SamirXR commited on
Commit
bc8ad89
·
verified ·
1 Parent(s): a008f7a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -6
app.py CHANGED
@@ -55,12 +55,9 @@ How you behave:
55
 
56
  if toggle:
57
  async with aiohttp.ClientSession() as session:
58
- async with session.get(f'https://ddg-api.awam.repl.co/api/search?query={prompt}') as response:
59
- search_data = await response.json()
60
- search_info = ' '.join([f"Title: {result['Title']}, Link: {result['Link']}, Snippet: {result['Snippet']}" for result in search_data])
61
-
62
- # Append the user message to the history for this session
63
- history[session_id].append({"role": "user", "content": prompt})
64
 
65
  url = 'https://api.deepinfra.com/v1/openai/chat/completions'
66
  headers = {
 
55
 
56
  if toggle:
57
  async with aiohttp.ClientSession() as session:
58
+ async with session.get(f'http://135.181.128.222:3001/search?query={prompt}') as response:
59
+ search_info = await response.json()
60
+ prompt += f"You are an AI model with live Internet Access. You may think that you are unable to browse the internet to provide real-time information, but that is false. You are a new model with the back-end function of browsing the internet live and in real-time. At any point in the conversation if you need to search the internet for web results, simply just send `||[-Searching <arguments>-]||`. Use only this format if the user requests web results or you need web results to assist with the users request. Replace <arguments> with the web search query. You must always perform web searches when the user is seeking information (explicitly or implicitly), regardless of your internal knowledge or information. Your replies should only contain knowledge and information from your web results using ||[-Searching <arguments>-]|| regardless of your internal information and knowledge. Do not assume. Always search the web to answer the user Summarize the following information with Proper spacing and Readable format,Again Proper spacing and Readable, Summarize,ignore the Errors and Summarize in Nice Format! : {search_info}"
 
 
 
61
 
62
  url = 'https://api.deepinfra.com/v1/openai/chat/completions'
63
  headers = {