toFilePart method

LLMFilePart toFilePart({
  1. String? mimeType,
})

任意ファイル(PDF など)のパーツを生成する。

Implementation

LLMFilePart toFilePart({String? mimeType}) => LLMFilePart.bytes(
      readAsBytesSync(),
      mimeType: mimeType ?? _mimeFromPath(path, 'application/octet-stream'),
      filename: uri.pathSegments.isNotEmpty ? uri.pathSegments.last : null,
    );