call method
Future<Output>
call(
- Input? input, {
- StreamingCallback<
Chunk> ? onChunk, - Map<
String, dynamic> ? context, - Stream<
Input> ? inputStream, - Init? init,
- TraceStartCallback? onTraceStart,
- CancellationToken? cancel,
Implementation
Future<Output> call(
Input? input, {
StreamingCallback<Chunk>? onChunk,
Map<String, dynamic>? context,
Stream<Input>? inputStream,
Init? init,
TraceStartCallback? onTraceStart,
CancellationToken? cancel,
}) async {
return (await run(
input,
onChunk: onChunk,
context: context,
inputStream: inputStream,
// Validate `init` against the schema, matching `runRaw`. The static type
// only guarantees shape; value-level constraints (enum membership,
// numeric ranges, required nested fields) still need the schema. Skip
// when either the schema or the value is absent, mirroring `runRaw`.
init: (initSchema != null && init != null)
? initSchema!.parse(init)
: init,
onTraceStart: onTraceStart,
cancel: cancel,
)).result;
}