esta guardar e nao esta a entar no perfil

This commit is contained in:
2026-03-17 17:08:44 +00:00
parent 1fcd2d0da5
commit 49252c391a
84 changed files with 2109 additions and 1446 deletions

View File

@@ -11,14 +11,33 @@ import com.google.common.util.concurrent.ListenableFuture;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
import com.google.ai.client.generativeai.type.BlockThreshold;
import com.google.ai.client.generativeai.type.HarmCategory;
import com.google.ai.client.generativeai.type.SafetySetting;
import java.util.Arrays;
import java.util.List;
import java.util.Collections;
public class Gemini {
private final GenerativeModelFutures modelo;
public Gemini() {
// 1. Configurar o modelo (usa a tua API Key do Google AI Studio)
// 1. Configurar os SafetySettings para permitir termos médicos e partes do corpo
List<SafetySetting> safetySettings = Arrays.asList(
new SafetySetting(HarmCategory.HARASSMENT, BlockThreshold.NONE),
new SafetySetting(HarmCategory.HATE_SPEECH, BlockThreshold.NONE),
new SafetySetting(HarmCategory.SEXUALLY_EXPLICIT, BlockThreshold.NONE),
new SafetySetting(HarmCategory.DANGEROUS_CONTENT, BlockThreshold.NONE)
);
// 2. Configurar o modelo (usa a tua API Key do Google AI Studio)
GenerativeModel generativeModel = new GenerativeModel(
"gemini-2.5-flash",
"AIzaSyBmLgn-SHaTDvAeDWsw2iTZRR9gahhOu7k");
"AIzaSyBmLgn-SHaTDvAeDWsw2iTZRR9gahhOu7k",
null, // generationConfig
safetySettings
);
this.modelo = GenerativeModelFutures.from(generativeModel);
}