Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -162,13 +162,13 @@ def sanitizar_texto(texto: str) -> str:
|
|
| 162 |
# NOTA: Verifique se o modelo suporta 'thinking_config'. Se der erro, remova essa linha.
|
| 163 |
# Models como gemini-2.0-flash-thinking suportam. O 2.5-pro padr茫o pode n茫o suportar.
|
| 164 |
thinking_config = None
|
| 165 |
-
|
| 166 |
-
|
| 167 |
|
| 168 |
generate_content_config = types.GenerateContentConfig(
|
| 169 |
temperature=temperatura,
|
| 170 |
max_output_tokens=max_tokens,
|
| 171 |
-
|
| 172 |
tools=tools,
|
| 173 |
response_mime_type="application/json" # For莽a JSON nativo se o modelo suportar
|
| 174 |
)
|
|
|
|
| 162 |
# NOTA: Verifique se o modelo suporta 'thinking_config'. Se der erro, remova essa linha.
|
| 163 |
# Models como gemini-2.0-flash-thinking suportam. O 2.5-pro padr茫o pode n茫o suportar.
|
| 164 |
thinking_config = None
|
| 165 |
+
if "thinking" in model_name: # L贸gica opcional para ativar apenas se for modelo thinking
|
| 166 |
+
thinking_config = types.ThinkingConfig(thinking_budget=8192)
|
| 167 |
|
| 168 |
generate_content_config = types.GenerateContentConfig(
|
| 169 |
temperature=temperatura,
|
| 170 |
max_output_tokens=max_tokens,
|
| 171 |
+
thinking_config=thinking_config, # Descomente se tiver certeza que o modelo suporta
|
| 172 |
tools=tools,
|
| 173 |
response_mime_type="application/json" # For莽a JSON nativo se o modelo suportar
|
| 174 |
)
|