Class GeminiMediaConverter
java.lang.Object
io.agentscope.extensions.model.gemini.formatter.GeminiMediaConverter
Converter for Gemini API multimodal content.
Converts ImageBlock, AudioBlock, and VideoBlock to Gemini Part objects with inline data.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.google.genai.types.PartconvertToInlineDataPart(io.agentscope.core.message.AudioBlock block) Convert AudioBlock to Gemini Part with inline data.com.google.genai.types.PartconvertToInlineDataPart(io.agentscope.core.message.DataBlock block) Convert DataBlock to Gemini Part with inline data.com.google.genai.types.PartconvertToInlineDataPart(io.agentscope.core.message.ImageBlock block) Convert ImageBlock to Gemini Part with inline data.com.google.genai.types.PartconvertToInlineDataPart(io.agentscope.core.message.VideoBlock block) Convert VideoBlock to Gemini Part with inline data.
-
Constructor Details
-
GeminiMediaConverter
public GeminiMediaConverter()
-
-
Method Details
-
convertToInlineDataPart
public com.google.genai.types.Part convertToInlineDataPart(io.agentscope.core.message.ImageBlock block) Convert ImageBlock to Gemini Part with inline data.- Parameters:
block- ImageBlock to convert- Returns:
- Part object containing inline data
-
convertToInlineDataPart
public com.google.genai.types.Part convertToInlineDataPart(io.agentscope.core.message.AudioBlock block) Convert AudioBlock to Gemini Part with inline data.- Parameters:
block- AudioBlock to convert- Returns:
- Part object containing inline data
-
convertToInlineDataPart
public com.google.genai.types.Part convertToInlineDataPart(io.agentscope.core.message.VideoBlock block) Convert VideoBlock to Gemini Part with inline data.- Parameters:
block- VideoBlock to convert- Returns:
- Part object containing inline data
-
convertToInlineDataPart
public com.google.genai.types.Part convertToInlineDataPart(io.agentscope.core.message.DataBlock block) Convert DataBlock to Gemini Part with inline data.MIME type resolution order:
Base64Source.mediaType— always explicitURLSource.mimeType— caller-supplied hint for extension-less URLs- Extension-based inference via
getMimeType(java.lang.String, java.lang.String)
- Parameters:
block- DataBlock to convert- Returns:
- Part object containing inline data
-