ariansyahdedy commited on
Commit
0ccc62e
·
1 Parent(s): a258c1b

google search implemented

Browse files
app/services/__init__.py ADDED
File without changes
app/services/message.py CHANGED
@@ -13,7 +13,7 @@ from typing import List, Dict, Any, Optional
13
  from app.utils.load_env import ACCESS_TOKEN, WHATSAPP_API_URL, GEMNI_API, OPENAI_API
14
  from app.utils.system_prompt import system_prompt
15
 
16
-
17
  # Load environment variables
18
  load_dotenv()
19
 
@@ -140,7 +140,7 @@ async def generate_response_from_gemini(
140
  pass # Placeholder for video processing logic
141
 
142
  # Send the user's message
143
- response = await chat.send_message_async(content)
144
  return response.text
145
 
146
  except Exception as e:
 
13
  from app.utils.load_env import ACCESS_TOKEN, WHATSAPP_API_URL, GEMNI_API, OPENAI_API
14
  from app.utils.system_prompt import system_prompt
15
 
16
+ from app.services.search_engine import google_search
17
  # Load environment variables
18
  load_dotenv()
19
 
 
140
  pass # Placeholder for video processing logic
141
 
142
  # Send the user's message
143
+ response = await chat.send_message_async(content, tools=google_search)
144
  return response.text
145
 
146
  except Exception as e:
{tools → app/services}/search_engine.py RENAMED
@@ -1,5 +1,4 @@
1
  import requests
2
-
3
  import logging
4
  import httpx
5
  from dotenv import load_dotenv
 
1
  import requests
 
2
  import logging
3
  import httpx
4
  from dotenv import load_dotenv