Docfile commited on
Commit
bbf955a
·
verified ·
1 Parent(s): 114b9ec

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -22
app.py CHANGED
@@ -387,30 +387,29 @@ Réponse:"""
387
  active_model = gemini_client.models.generate_content(
388
  model_name=selected_model_name,
389
  contents = contents_for_gemini
390
- config = types.GenerateContentConfig(
391
- system_instruction=SYSTEM_INSTRUCTION,
392
- safety_settings=[
393
-
394
- types.SafetySetting(
395
- category=types.HarmCategory.HARM_CATEGORY_HATE_SPEECH,
396
- threshold=types.HarmBlockThreshold.BLOCK_LOW_AND_ABOVE,
397
- ),
398
- types.SafetySetting(
399
- category=types.HarmCategory.HARM_CATEGORY_HARASSMENT,
400
- threshold=types.HarmBlockThreshold.BLOCK_LOW_AND_ABOVE,
401
- ),
402
- types.SafetySetting(
403
- category=types.HarmCategory.HARM_CATEGORY_SEXUALLY_EXPLICIT,
404
- threshold=types.HarmBlockThreshold.BLOCK_LOW_AND_ABOVE,
405
- ),
406
- types.SafetySetting(
407
- category=types.HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT,
408
- threshold=types.HarmBlockThreshold.BLOCK_LOW_AND_ABOVE,
409
- )
410
- ]
411
- )
412
  ),
 
 
 
 
 
 
 
413
  )
 
 
 
414
 
415
  print(f" Envoi de la requête à {selected_model_name} ({len(contents_for_gemini)} messages/tours)...")
416
  # Appel API (non-streamé pour correspondre au code précédent)
 
387
  active_model = gemini_client.models.generate_content(
388
  model_name=selected_model_name,
389
  contents = contents_for_gemini
390
+ config = types.GenerateContentConfig(
391
+ system_instruction=SYSTEM_INSTRUCTION,
392
+ safety_settings=[
393
+
394
+ types.SafetySetting(
395
+ category=types.HarmCategory.HARM_CATEGORY_HATE_SPEECH,
396
+ threshold=types.HarmBlockThreshold.BLOCK_LOW_AND_ABOVE,
397
+ ),
398
+ types.SafetySetting(
399
+ category=types.HarmCategory.HARM_CATEGORY_HARASSMENT,
400
+ threshold=types.HarmBlockThreshold.BLOCK_LOW_AND_ABOVE,
 
 
 
 
 
 
 
 
 
 
 
401
  ),
402
+ types.SafetySetting(
403
+ category=types.HarmCategory.HARM_CATEGORY_SEXUALLY_EXPLICIT,
404
+ threshold=types.HarmBlockThreshold.BLOCK_LOW_AND_ABOVE,
405
+ ),
406
+ types.SafetySetting(
407
+ category=types.HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT,
408
+ threshold=types.HarmBlockThreshold.BLOCK_LOW_AND_ABOVE,
409
  )
410
+ ]
411
+ )
412
+ )
413
 
414
  print(f" Envoi de la requête à {selected_model_name} ({len(contents_for_gemini)} messages/tours)...")
415
  # Appel API (non-streamé pour correspondre au code précédent)