Class AntsGoogleGenAI

java.lang.Object
com.ants.platform.guardrails.providers.AntsGoogleGenAI

public class AntsGoogleGenAI extends Object
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"))
 );
 
  • Method Details

    • builder

      public static AntsGoogleGenAI.Builder 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