upload method
Future<HostedFileContent>
upload(
- Stream<
List< content, {int> > - String? mediaType,
- String? fileName,
- HostedFileClientOptions? options,
- CancellationToken? cancellationToken,
override
Uploads a file to the AI service.
Returns a HostedFileContent with metadata about the uploaded file.
Implementation
@override
Future<HostedFileContent> upload(
Stream<List<int>> content, {
String? mediaType,
String? fileName,
HostedFileClientOptions? options,
CancellationToken? cancellationToken,
}) async {
developer.log('Upload invoked: $fileName', name: _loggerName, level: 500);
final result = await super.upload(
content,
mediaType: mediaType,
fileName: fileName,
options: options,
cancellationToken: cancellationToken,
);
developer.log('Upload succeeded: ${result.fileId}', name: _loggerName, level: 500);
return result;
}