Class ContentUtils
java.lang.Object
uno.anahata.ai.internal.ContentUtils
Utility methods for working with the Google GenAI
Content object.- Author:
- Anahata
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic com.google.genai.types.ContentcloneAndRemoveParts(com.google.genai.types.Content original, List<com.google.genai.types.Part> partsToRemove) Creates a newContentobject that is a clone of the original, but with a list of specificParts removed.
-
Constructor Details
-
ContentUtils
public ContentUtils()
-
-
Method Details
-
cloneAndRemoveParts
public static com.google.genai.types.Content cloneAndRemoveParts(com.google.genai.types.Content original, List<com.google.genai.types.Part> partsToRemove) Creates a newContentobject that is a clone of the original, but with a list of specificParts removed.This is useful for pruning operations where specific parts of a message need to be discarded while preserving the rest of the content and the role.
- Parameters:
original- The original Content object.partsToRemove- The list of Parts to exclude from the new object.- Returns:
- A new Content object without the specified parts, or the original if no parts were removed.
-
