Package uno.anahata.ai.internal


package uno.anahata.ai.internal
Provides a comprehensive suite of internal utility classes that support the core functionalities of the Gemini client.

This package contains essential helper classes for a wide range of operations, but they are designed for internal use and are not part of the public API. These utilities encapsulate critical logic for serialization, data handling, and text processing.

Key Responsibilities:

  • Serialization:
    • KryoUtils: Manages a pre-configured, thread-safe Kryo instance for high-performance serialization and deserialization of chat sessions.
    • GsonUtils: Provides a customized Gson instance for robust JSON handling, including a smart pretty-printer.
  • Content and Data Handling:
    • ContentUtils: Offers methods for the immutable manipulation of Content objects.
    • PartUtils: A versatile helper for creating and analyzing Part objects, including MIME type detection and token count estimation.
    • TikaUtils: A clean wrapper around Apache Tika for file type detection and content extraction.
  • Text Processing:
    • TextUtils: A powerful utility for processing and formatting text, featuring pagination, regex filtering (grep), and intelligent line truncation.

Subpackages:

  • Classes
    Class
    Description
    Utility methods for working with the Google GenAI Content object.
    Utility class for GSON-based JSON operations.
    A generic utility class for Jackson-based JSON operations.
    Utility class for high-performance object serialization using the Kryo library.
    Utility methods for working with Gemini Part objects.
    Utility methods for processing and formatting text content.
    Utility class for file type detection and content extraction using Apache Tika.