Class AntsGoogleGenAI
java.lang.Object
com.ants.platform.guardrails.providers.AntsGoogleGenAI
Google Generative AI (Gemini) wrapper with guardrail enforcement and trace logging.
var client = AntsGoogleGenAI.builder()
.googleApiKey("AIza...")
.antsApiKey("pk:sk")
.agentId("agent_123")
.build();
JsonNode response = client.generateContent(
"gemini-2.0-flash",
List.of(Map.of("role", "user", "content", "Hello"))
);
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic AntsGoogleGenAI.Builderbuilder()com.fasterxml.jackson.databind.JsonNodeGenerate content using Google Generative AI with guardrail checks.
-
Method Details
-
builder
-
generateContent
public com.fasterxml.jackson.databind.JsonNode generateContent(String model, List<Map<String, String>> messages) Generate content using Google Generative AI with guardrail checks. A trace is logged asynchronously after each call.- Parameters:
model- Gemini model ID (e.g. "gemini-2.0-flash")messages- list of message maps with "role" and "content" keys- Returns:
- raw JSON response from the generateContent API
-