类 OpenAIConverterUtils
java.lang.Object
io.agentscope.core.formatter.openai.OpenAIConverterUtils
Utility class for OpenAI message and conversation conversion.
-
方法概要
修饰符和类型方法说明static StringconvertImageSourceToUrl(Source source) Convert an image source to a URL string.static StringconvertVideoSourceToUrl(Source source) Convert a video source to a URL string.static StringdetectAudioFormat(String mediaType) Detect audio format from media type.
-
方法详细资料
-
convertImageSourceToUrl
Convert an image source to a URL string.- 参数:
source- The image source (URLSource or Base64Source)- 返回:
- The URL string or data URI
- 抛出:
IllegalArgumentException- if source is null or of unknown type
-
detectAudioFormat
Detect audio format from media type.- 参数:
mediaType- The media type (e.g., "audio/wav")- 返回:
- The format string (e.g., "wav")
-
convertVideoSourceToUrl
Convert a video source to a URL string.- 参数:
source- The video source (URLSource or Base64Source)- 返回:
- The URL string or data URI
- 抛出:
IllegalArgumentException- if source is null or of unknown type
-