Class NaruGeminiNativeResponseParser

java.lang.Object
net.thevpc.naru.ext.models.gemini.NaruGeminiNativeResponseParser
All Implemented Interfaces:
net.thevpc.nuts.elem.NElementDeserializer<NaruResponse>

public class NaruGeminiNativeResponseParser extends Object implements net.thevpc.nuts.elem.NElementDeserializer<NaruResponse>
Parses a native Gemini generateContent response.
 {
   "candidates": [{
     "content": {"role": "model", "parts": [
        {"text": "..."},
        {"functionCall": {"name": "search", "args": {"q": "naru"}}}
     ]},
     "finishReason": "STOP" | "MAX_TOKENS" | "SAFETY"
   }],
   "usageMetadata": {
     "promptTokenCount": 100,
     "candidatesTokenCount": 20,
     "totalTokenCount": 120,
     "cachedContentTokenCount": 80
   }
 }
 
  • Constructor Details

    • NaruGeminiNativeResponseParser

      public NaruGeminiNativeResponseParser()
  • Method Details

    • toObject

      public NaruResponse toObject(net.thevpc.nuts.elem.NElementDeserializerContext context)
      Specified by:
      toObject in interface net.thevpc.nuts.elem.NElementDeserializer<NaruResponse>