embeddingParts function

List<EmbeddingPart> embeddingParts(
  1. EmbedderInput input
)

The parts of input, in request order: the text (its task prefix already in front), then the images, then the audio clip.

Implementation

List<EmbeddingPart> embeddingParts(EmbedderInput input) => [
  if (input.text case final text?)
    (kind: EmbeddingPartKind.text, bytes: utf8.encode(text)),
  for (final image in input.images)
    (kind: EmbeddingPartKind.image, bytes: image),
  if (input.audio case final audio?)
    (kind: EmbeddingPartKind.audio, bytes: audio),
];