Interface StandardContentBlockConverter<Formats>

Utility interface for converting between standard and provider-specific data content blocks, to be used when implementing chat model providers.

Meant to be used with convertToProviderContentBlock and convertToStandardContentBlock rather than being consumed directly.

interface StandardContentBlockConverter<Formats> {
    providerName: string;
    fromStandardAudioBlock?(block: StandardAudioBlock): Formats["audio"];
    fromStandardFileBlock?(block: StandardFileBlock): Formats["file"];
    fromStandardImageBlock?(block: StandardImageBlock): Formats["image"];
    fromStandardTextBlock?(block: StandardTextBlock): Formats["text"];
}

Type Parameters

Properties

providerName: string

The name of the provider type that corresponds to the provider-specific content block types that this converter supports.

Methods