类 OpenAIConverterUtils

java.lang.Object
io.agentscope.core.formatter.openai.OpenAIConverterUtils

public final class OpenAIConverterUtils extends Object
Utility class for OpenAI message and conversation conversion.
  • 方法详细资料

    • convertImageSourceToUrl

      public static String convertImageSourceToUrl(Source source)
      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

      public static String detectAudioFormat(String mediaType)
      Detect audio format from media type.
      参数:
      mediaType - The media type (e.g., "audio/wav")
      返回:
      The format string (e.g., "wav")
    • convertVideoSourceToUrl

      public static String convertVideoSourceToUrl(Source source)
      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