Skip to content

MediaTypeDetector

Namespace: Vercel.AI.Operations

public static class MediaTypeDetector

Detects media types from file signatures.

Inheritance: object

View source

public static string? Detect(byte[]? data, string? topLevelType)

Returns a media type for <code class=“paramref”>data</code>, or null when no signature matches.

Parameters

Name Type Description
data byte[]
topLevelType string

Returns: string

View source

public static byte[] ToBytes(object? data)

Decodes a base64 payload or returns the bytes unchanged.

Parameters

Name Type Description
data object

Returns: byte[]

View source

Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product