Update app.py
Browse files
app.py
CHANGED
|
@@ -120,23 +120,8 @@ def perform_web_search_with_gemini(query, client, model_id):
|
|
| 120 |
"""Effectue une recherche web via l'API Google Search intégrée à Gemini."""
|
| 121 |
try:
|
| 122 |
print(f"--- LOG WEBSEARCH: Recherche Google avec Gemini pour: '{query}'")
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
response = client.models.generate_content(
|
| 126 |
-
model=model_id,
|
| 127 |
-
contents=[{"role": "user", "parts": [{"text": query}]}],
|
| 128 |
-
config=types.GenerateContentConfig(
|
| 129 |
-
tools=[{"google_search": {}}]
|
| 130 |
-
)
|
| 131 |
-
)
|
| 132 |
-
"""
|
| 133 |
-
response = client.models.generate_content(
|
| 134 |
-
model=model_id,
|
| 135 |
-
contents=[{"role": "user", "parts": [{"text": query}]}],
|
| 136 |
-
config=types.GenerateContentConfig(
|
| 137 |
-
tools=[types.Tool(google_search=types.GoogleSearchToolConfig())]
|
| 138 |
-
)
|
| 139 |
-
)
|
| 140 |
|
| 141 |
print("--- LOG WEBSEARCH: Résultats de recherche Google obtenus.")
|
| 142 |
|
|
|
|
| 120 |
"""Effectue une recherche web via l'API Google Search intégrée à Gemini."""
|
| 121 |
try:
|
| 122 |
print(f"--- LOG WEBSEARCH: Recherche Google avec Gemini pour: '{query}'")
|
| 123 |
+
|
| 124 |
+
response = client.models.generate_content(model=model_id,contents=[{"role": "user", "parts": [{"text": query}]}],config=types.GenerateContentConfig(tools=[types.Tool(google_search=types.GoogleSearchToolConfig())]))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 125 |
|
| 126 |
print("--- LOG WEBSEARCH: Résultats de recherche Google obtenus.")
|
| 127 |
|