Skip to main content
View module source on GitHub

GeminiUtils

parse_gemini_generation_content

Parse the generation response from Google’s Generative AI API into a standardized format. Arguments: Returns: Dict[str, Any]: A dictionary containing the parsed response with standardized fields:
  • usage: Token counts for prompt and completion
  • id: Generated UUID for the response
  • created: Unix timestamp of when response was parsed