run method
Runs all steps and returns the accumulated context.
Implementation
Future<Map<String, Object?>> run(
AiStreamClient client,
Map<String, Object?> input, {
required String model,
double? temperature,
int? maxTokens,
}) async {
final context = <String, Object?>{'input': input};
for (final step in steps) {
final prompt = _interpolate(step.prompt, context);
final response = await _complete(
client,
prompt,
model: model,
temperature: temperature,
maxTokens: maxTokens,
);
context[step.outputKey] = step.parse(response);
}
return context;
}