Class OpenAIConverterUtils
java.lang.Object
io.agentscope.extensions.model.openai.formatter.OpenAIConverterUtils
Utility class for OpenAI message and conversation conversion.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringconvertImageSourceToUrl(io.agentscope.core.message.Source source) Convert an image source to a URL string.static StringconvertVideoSourceToUrl(io.agentscope.core.message.Source source) Convert a video source to a URL string.static StringdetectAudioFormat(String mediaType) Detect audio format from media type.
-
Method Details
-
convertImageSourceToUrl
Convert an image source to a URL string.- Parameters:
source- The image source (URLSource or Base64Source)- Returns:
- The URL string or data URI
- Throws:
IllegalArgumentException- if source is null or of unknown type
-
detectAudioFormat
Detect audio format from media type.- Parameters:
mediaType- The media type (e.g., "audio/wav")- Returns:
- The format string (e.g., "wav")
-
convertVideoSourceToUrl
Convert a video source to a URL string.- Parameters:
source- The video source (URLSource or Base64Source)- Returns:
- The URL string or data URI
- Throws:
IllegalArgumentException- if source is null or of unknown type
-